did
unread,Jan 26, 2009, 11:40:22 AM1/26/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Paperclip Plugin
Hi guys,
I try to upload animated gif and it fails when paperclip tries to crop
the gif image. I've got a NaN error because both width and height are
set to 0. I tested it on Mac os x and Linux (ImageMagick 6.4.0
03/31/08)
I checked the code and found out that the command used to retrieve
dimensions returned, in my case, this:
> identify -format "%wx%h" pdfcreator.gif
468x60466x60468x60468x60468x60468x60468x60435x60442x60450x60456x60465x60468x60468x60...
(I skipped the value but you get the picture)
It does not sound weird since an animated gif is composed of many
images. That's why the identify command returns the dimension of all
the "frames".
Back to paperclip code. The 'parse' method of the Geometry class can
not get the dimension from the previous result. So, I made a tiny
(dirty ?) change in 'from_file' (Geometry class) by modifying the
expected format:
"%wx%h " (I added an empty space) so that identify returns "468x60
466x60 ....". So far it works. I ran the unit and it did not seem to
break any test.
Am I missing something here ? Did somebody meet this problem before ?
Hope it helps.
Did