eltiare / carrierwave-vips

CarrierWave image processing powered by VIPS
MIT License
92 stars 39 forks source link

Bug fix for `image` being overwritten from VIPS::Image.new(current_path) in #resize_image #8

Closed tehprofessor closed 11 years ago

tehprofessor commented 11 years ago

Previously, when resize_image was called, it would re-read the image from disk (adding the amount of shrink, and setting :sequential to true). This caused previous manipulations to be erased; this was especially problematic when trying to crop a photo using extract_area and then resize it to fill.

This may not be the best fix, but it works. I was unable to find a method to set :sequential to true in ruby-vips; perhaps, I just didnt look hard enough.

Please let me know if you need anything changed, or if I can prepare my commit better.

Best, Seve

eltiare commented 11 years ago

I'll take a look at it. Something about that bit of code has always bothered me. Hopefully by the end of this week.

tehprofessor commented 11 years ago

Howdy,

I was wondering if you had any feedback/status update on the commit? No worries if you haven't had the time-- just making sure there's nothing, yet, I can do to help.

Best, Seve

eltiare commented 11 years ago

I reworked things so as to have the file be loaded sequentially on load if it's a JPEG or a PNG. Most of the code was moved to manipulate!. Let me know if this fixes it for you. I added a pending test and if you could write a test for your particular need that would be great.