This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » eZ Publish 5 Platform » [EZ 5.4] Image variations JPEG quality
expandshrink

[EZ 5.4] Image variations JPEG quality

[EZ 5.4] Image variations JPEG quality

Monday 16 March 2015 3:02:28 pm - 6 replies

Hi,

I'm using EZ 5.4 with LiipImagineBundle and I'm wondering what's the right way to set the jpeg quality of the image variations?

In the documentation (https://doc.ez.no/display/EZP/Image+alias+generation) the quality setting is not mentioned although I think that's an important aspect.

I tried setting "jpeg_quality" in ezpublish.yml (like described in http://symfony.com/doc/master/bundles/LiipImagineBundle/configuration.html) but that has no effect either.

All images variations are saved with 100% quality which leads to some very huge image files.

Thanks for any contributions to this topic!

Regards,
Daniel

Tuesday 17 March 2015 10:46:32 am

Hello Daniel,

I want to take a moment to agree with you that it would be very helpful if the eZ documentation regarding quality was improved / clarified.

I need to ask you specifically what community build are you using? Also what version of LiipImagineBundle your using? These are important questions because support for the feature you describe is actually very version specific.

Because the jpeg_quality feature setting was very recently introduced into the bundle in question.

Because this feature is so new it is (to my limited knowledge) not yet used / distributed by default in eZ.

Currently eZ uses an older version in the kernel's composer.json,

https://github.com/ezsystems/ezpu...kernel/blob/master/composer.json#L32

Which I cross referenced to this version / commit / tag / package version,

https://github.com/liip/LiipImagineBundle/commit/92e6495

https://github.com/liip/LiipImagineBundle/commits/master?page=4

https://packagist.org/packages/liip/imagine-bundle

https://github.com/liip/LiipImagineBundle/tree/1.0.0

Note in my last link above that the README.md documentation only talks about the 'quality' setting as 'jpeg_quality' setting (among many others) was not introduce until much later the next year in PR #473, https://github.com/liip/LiipImagi...907540a796882884a4bba287a00347b8e74e

Now, all that said, if quality setting in the older version is not good enough, you -might- be able to force composer to use a newer version, (v1.2.3) but I'm not entirely certain on ez usage / compatibility within this regard, i think it's well worth testing / trying / experimenting / learning / sharing.

Note that I only know any of this because the topic has come up in #ezpublish irc chats and kracker did a lot of research on this topic exactly.

I hope this helps!

Cheers,
Heath

Tuesday 17 March 2015 4:13:41 pm

Hi Heath,

thanks for your answer!

I'm using the 2014.11.1 ezpublish-kernel release and the liip-imagine-bundle that comes with this version. After your comment i tried some different methods to set the jpeg quality:

1) Setting the jpeg quality in the ez image variations:

ezpublish:
    system:
        global:
            image_variations:
                my_variation:
                    quality: 60
                    jpeg_quality: 60

Doesn't work, error on clear:cache. Options unknown.

2) Setting the jpeg quality in the liip_imagine block (additionally to the setting above in "image_variations"blunk.gif Emoticon:

liip_imagine:
    driver: imagick
    filter_sets:
        my_variation:
            quality: 70
            jpeg_quality: 70

Doesn't work, the 100% quality setting from the image_variations setting is used.

3) Setting the jpeg quality in the liip_image block only (the image variation MUST NOT be defined in the image_variation block):

liip_imagine:
    driver: imagick
    filter_sets:
        my_variation:
            quality: 70
            jpeg_quality: 70

This one works! I also found out that both settings (quality + jpeg_quality) are used, but I would prefer "jpeg_quality" since "quality" is deprecated.

@ez: It would be nice if the different quality settings could be used directly inside the image variations block.

Regards,
Daniel

Tuesday 17 March 2015 9:40:11 pm

Hello there,

I have looked through the imagine bundle's pull-request to the kernel, and I can't see anything that would allow this parameter. I guess we need to "allow" a quality option in each filter's options.

I'm just unsure why the quality is forced to 100% when the alias is set, that's a bit odd...

I'll ping those who'd know. Of course, pull-requests, or branches for discussion/guidance, are accepted as well happy.gif Emoticon

Wednesday 18 March 2015 7:05:09 am

Thanks Bertrand! Setting the (jpeg_)quality option directly inside the image_variations block would simplify things happy.gif Emoticon

Thursday 19 March 2015 1:27:32 pm

Do you think you could create an enhancement on http://jira.ez.no ? What you described above is more than enough as a description.

We'll discuss it in the team, and will suggest it to the product manager.

Monday 23 March 2015 12:54:20 pm

Sure happy.gif Emoticon

https://jira.ez.no/browse/EZP-24167

Modified on Monday 23 March 2015 1:05:32 pm by Daniel Mühlbacher

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from