retina_rails
retina_rails copied to clipboard
Error generating "retina_dimensions" if filename is not URL friendly
I've come across what seems to be a bug.
My user profile pictures are uploaded by users, therefore susceptible to some funky file names... If a user uploads a file with an apostrophe in the filename in my particular case isn't.jpg
, the generation of the retina_dimensions field all gets set to 0 for all styles.
I thought I could get around this by simply doing a transliterate on the filename before upload in a before_post_process
method to get rid of any unwanted characters and clean the filename to be url friendly. However, while I can successfully clean the filename, the retina_rails plugin seems to be calling for the retina_demensions before I change the filename, so before the before_post_process
call; resulting in my retina_dimensions to be saved as 0.
Have you seen anything like this before?
Let me know if you need anymore details.
I will look through the source of the plugin when I get a chance tomorrow and see if I can find where this is happening.
Best,
Waylon
This is when using Paperclip, btw.