gzigzigzeo / carrierwave-meta

File's metadata saving plugin for carrierwave
MIT License
85 stars 48 forks source link

Fallback meta to original image if you don't have one of the processed ones. #18

Open gotjosh opened 10 years ago

gotjosh commented 10 years ago

The way carrierwave works with fallback images is the following:

Let's say you have an uploader with an additional process of a thumbnail. If for some reason the thumbnail process fails it falls back to the original image. IE.

@product.image.thumbnail.url => #return the url of the original image if you don't have a thumbnail

This doesn't work for the meta. If you would do the following:

@product.image.thumbnail.width => 0

You would get 0 because the thumbnail never got processed, shouldn't it fallback to running the identify on the original image or maybe delegate the methods? I'd be happy to submit a pull request if I could be pointed in the right direction.

This clearly becomes a problem when you're testing your UI and you don't have access to your meta, because you turned processing off.