openlibhums / janeway

A web-based platform for publishing journals, preprints, conference proceedings, and books
https://janeway.systems/
GNU Affero General Public License v3.0
175 stars 65 forks source link

Pixelation of large images #4222

Open joemull opened 5 months ago

joemull commented 5 months ago

User story

From Field editors: “I was wondering if there was a way of increasing the resolution of the 'large images' used as banner in articles. I can see that the system compresses images to 750px wide which means they are pixelated when rendered at 1200px. Given that we are a visual discipline, it would be fantastic if we could allow for a slightly higher resolution.”

Investigation results

Janeway does not consistently handle the cropping of large images. When you upload a large image to most forms, it is sent through resize_and_crop with a max width of 750 and a max height of 324.

An example from Field:

But default images are left alone when they are saved through the Images page in the Journal Manager. This is because this view is built with edit_settings_group, which does not call resize_and_crop. An example from Political Philosophy:

The other important thing to note is that all three themes allow the display of these images at more than 750px wide, inevitably leading to pixelation, whatever theme you use, if you upload images through any form other than the default settings page.

Proposed solution

Given that lots of large images are not cropped already, and that the images that are cropped are pixelated in any theme, I think we should rethink the resize_and_crop routine, perhaps by enlarging the dimensions to meet the max width allowed by the themes. If we do this, we should also resize the default large image the same way, so that we are not storing and serving unecessary pixels.

Other solutions

Happy to discuss alternatives if there is a good reason to keep the cropping to 750 x 324 that I am unaware of.

StephDriver commented 1 month ago

decisions: