empowerhack / DrawMyLife-Service

API and Admin system for the Draw My Life initiative - Volunteers: check README and GitHub Projects to get started.
https://github.com/empowerhack/DrawMyLife-Service/projects
MIT License
13 stars 0 forks source link

Allows pdfs to be uploaded and converted #101

Closed steverabino closed 7 years ago

steverabino commented 7 years ago

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=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.


krissy commented 7 years ago

:+1: 💃