Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When rendering thumbnails, configure target format #2320

Closed
kdambekalns opened this issue Dec 13, 2018 · 5 comments
Closed

When rendering thumbnails, configure target format #2320

kdambekalns opened this issue Dec 13, 2018 · 5 comments
Assignees
Labels

Comments

@kdambekalns
Copy link
Member

Description

When rendering thumbnails, currently the input format is used as output format. I.e. when a WebP image is uploaded, any variant will also be a WebP image.

Sometimes it might be desired to render variants as JPG or PNG, e.g. when a larger WebP or TIFF is uploaded for later download, but previews should be viewable in any client (regardless of their ability display WebP or TIFF).

This could either be achieved by an option to pass when fetching a thumbnail for display (Fluid, Fusion, …) or by a setting that affects all created variants (of a certain type).

@daniellienert
Copy link
Member

What? I didn't knew that we use the input as output format. But

$resultingFileExtension = $originalResource->getFileExtension();
and further down the Imagine code does just that.

Aside from the WebP case, I doubt someone really wants to have TIFF thumbnails.
I would go for the settings option, with a default to render thumbnails as jpeg and a possibility to set individual output formats, something like

outputFormat:
  default: 'image/jpeg'
  'image/png': 'image/png'

Should be easily doable in the ImageService.

@kdambekalns kdambekalns self-assigned this Dec 13, 2018
@mficzel
Copy link
Member

mficzel commented Mar 4, 2019

For WEBP a newer version of imagine (>1.0.0) is needed that includes this php-imagine/Imagine#504

@mficzel
Copy link
Member

mficzel commented Mar 4, 2019

I would consider it equally important to be able to control the format for each image that is created by Neos.Fusion:ImageUri , Neos.Media:ImageViewHelper or even the ThumbnailGenerator to support cases like this

<picture>
  <source type="image/webp" srcset="pyramid.webp"> 
  <img src="pyramid.png" alt="regular pyramid built from four equilateral triangles">
</picture>

@kdambekalns kdambekalns removed their assignment Mar 5, 2019
@kdambekalns
Copy link
Member Author

Feel free to take this, everyone…

@mficzel
Copy link
Member

mficzel commented Mar 5, 2019

A pr for the imagine update already exists neos/imagine#15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants