I’m running file_column 0.3.1, and having a few problems… which are:
Uploading a 378x567 jpg, and using :magick => {:geometry =>
“100x100” }, my image ends up being 67x100 ?
Is there a way to “force” the image to be the size you specify ?
My view has a drop-down of sizes, and I’m trying to pass in this
size into :magick => {:geometry => SIZE_HERE}.
I’ve tried replacing SIZE_HERE with self.size, replacing it with a @size instance variable in a “before_create”… etc, etc…
… but I can’t seem to get the proper value included in this hash
prior to it running.
Any insight into the above would be great,
Thank you !
Dylan,
Although you’re setting 100x100, the image proportions are being
constrained which is a good thing believe it or not. If the Proportions
weren’t then the image would come out looking squished and stretched. I
don’t believe anything exists that would be able to programmatically
change the image size without constraint to the proportions and still
have it looking good but I could be wrong. If their is, the best you
could hope for is that the image would be changed to 67X100 but
incorporated into another image that was 100X100. The result would be
white (or what ever color you chose) on either side.
Sorry, it may not be the answer you were looking for but at least your
on your way.
Scott.
Dylan S. wrote:
I’m running file_column 0.3.1, and having a few problems… which are:
Uploading a 378x567 jpg, and using :magick => {:geometry =>
“100x100” }, my image ends up being 67x100 ?
Is there a way to “force” the image to be the size you specify ?
My view has a drop-down of sizes, and I’m trying to pass in this
size into :magick => {:geometry => SIZE_HERE}.
I’ve tried replacing SIZE_HERE with self.size, replacing it with a @size instance variable in a “before_create”… etc, etc…
… but I can’t seem to get the proper value included in this hash
prior to it running.
Any insight into the above would be great,
Thank you !
ahh… brilliant, thanks Felix. the RMagick docs are huuuuge, and I
probably skipped right over this
there are about 100 instance methods for Image itself… and they are
all
actually very applicable
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.