I had to reconfigure my uploader. I'm using carrierwave
and minimagick
. So in a nutshell, I had images automatically processed/resized when they were initially uploaded before. Now I don't want them automatically processed, I'm keeping the original size and creating a version named normal
for the resized image.
Now some images that are uploaded will have the normal
version. But images that were uploaded prior to the reconfiguration won't. To avoid broken images, I've created a conditional that works great in development.
<% if car.picture_attachments.first.picture.normal.present? %>
<%= image_tag(car.picture_attachments.first.picture.normal.url) %>
<% else %>
<%= image_tag(car.picture_attachments.first.picture) %>
<% end %>
But in Heroku - it thinks every object has a normal
version and is serving a bunch of broken images as a result. I'm using Amazon S3 - any clue why this is happening?