It has been necessary to change the original image format to large, as using original actually edits the original, rather than making a copy called original which was expected. This image format is currently not used anywhere, so is not a problem currently.
However, if the large format is used in future, pictures uploaded before this change will fail to load the "large" format. I will look to fix this with a migration in the future.
After this change, we can run rake paperclip:refresh:missing_styles CLASS=Drawingto update existing images to create any styles that are missing.
PDFs uploaded were being given black edges, replacing transparency which existed. To trim transparency only, we need to add a small transparent border, then trim. This will ensure pictures with a coloured edge do not get trimmed incorrectly, yet the transparent edges from PDFs are trimmed.
[x] Enable pdf upload
[x] Migration to create large jpg format of all existing images - run rake paperclip:refresh:missing_styles CLASS=Drawingto update existing images
Deploy Instructions
run rake paperclip:refresh:missing_styles CLASS=Drawing to update existing images to give them a large version
This branch will allow PDFs to be uploaded.
It has been necessary to change the original image format to large, as using
original
actually edits the original, rather than making a copy called original which was expected. This image format is currently not used anywhere, so is not a problem currently.However, if the large format is used in future, pictures uploaded before this change will fail to load the "large" format. I will look to fix this with a migration in the future.After this change, we can run
rake paperclip:refresh:missing_styles CLASS=Drawing
to update existing images to create any styles that are missing.PDFs uploaded were being given black edges, replacing transparency which existed. To trim transparency only, we need to add a small transparent border, then trim. This will ensure pictures with a coloured edge do not get trimmed incorrectly, yet the transparent edges from PDFs are trimmed.
rake paperclip:refresh:missing_styles CLASS=Drawing
to update existing imagesDeploy Instructions
rake paperclip:refresh:missing_styles CLASS=Drawing
to update existing images to give them alarge
version