Hi everyone…
Since i can’t find noob friendly information about rmagick and
fleximage on the web, I’m here offering a beer for the one good soul
who can help me to get rid of my ignorance.
I’ve been trying for weeks to make fleximage to work, and now that it
does, I’d like to do the following:
class MyImage < FlexImage::Model
def fooify!
img = rmagick_image
# retrieve image's width and height
# compare both values to determine if the image is "portrait" or
“landscap” (if width > height, aspect_ratio = landscape, etc…)
# if image is "portrait", resizes it using a threshold of 200px
height, decreasing the width proportionally.
# else, if it’s landscape, it resizes to a 400px WIDTH, resizing
the height proportionally
# than store the image in a blob or filesystem, and the
aspect_ratio value in the DB
self.rmagick_image = img
self
end
end
My main point of ignorance is about how to gather information about
the image’s width and height.
The rest I think I can figure out myself (but since I took a lot of
time just to make fleximage work, I’m not so confident and I still
apreciate your kindness to share your thoughts on it, specially if you
think that creating a method inside the model isn’t the best aproach
and have better practices in mind)
I would really apreciate some help on this, and if you can do it, I
owe you a couple beers (however, you’ll have to come to brazil to
drink it)
Thank You