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

Can't create webp images with Resizer #64

Open
pepebe opened this issue Jul 3, 2020 · 4 comments
Open

Can't create webp images with Resizer #64

pepebe opened this issue Jul 3, 2020 · 4 comments

Comments

@pepebe
Copy link

pepebe commented Jul 3, 2020

I'm trying to create webp images with pthumb, but using Resizer instead of phpThumb seems to cause problems.

Steps to reproduce:

Create a webP Thumbnail with pThumb:

        <source 
            srcset="[[+crops.xl.url:pthumb=`w=1140&q=100&f=webP`]]"
            media="(min-width: 1200px)"
            data-breakpoint="xl"
            data-org="[[+crops.xl.url]]"
        />
  • Set phpthumbof.use_resizer == 0: webp images are created.
  • Set phpthumbof.use_resizer == 1: pthumb returns a crop in the original format located inside the image-cache and I find an error message inside the modx log file.
[2020-07-03 10:42:19] (ERROR @ /paas/*****/www/core/components/phpthumbof/model/phpthumbof.class.php : 156) [pThumb] Resource: 1 || Image: /paas/c0583/www/crops/lg.95a9428b.cm6p6087_1.jpg
Could not cache thumbnail to file at: /paas/*****/www/assets/image-cache/lg.95a9428b.cm6p6087_1.54dea866.webP
Resizer debug output:
    [0] => Resizer v1.0.1
    [1] => Using Imagick
    [2] => Input file: /paas/****/www/crops/lg.95a9428b.cm6p6087_1.jpg
    [3] => Input options: 
  'q' => '100',
  'f' => 'webP'
    [4] => *** Error *** Save operation failed

Environment:

  • modxcloud
  • modx 2.7.3
  • pthumb 2.3.3
  • contentblocks 1.8.15
  • resizer 1.0.2-beta

Regards,

pepebe

@pepebe
Copy link
Author

pepebe commented Jul 3, 2020

Quick update: The propblem seems to go deeper and the symptoms are highly erratic. I just saved the resource, reloaded the frontpage and suddenly all images are jpg again. Not a single webp image.

I'll investigate some more and post updates as soon as I find out more.

@sepiariver
Copy link

Hi @pepebe it has to do with the version of Imagine being used by Resizer. The latest version that could be used in Resizer is 0.7.x. Upgrading to 1.x and higher requires quite a bit of refactoring. I have a fork of Resizer in which I'm working on that, but it's slow going. If you are interested in collaborating on it, let's discuss :)

@patrickatwsrn
Copy link

@sepiariver My graphic-foo is limited, but I will try to support your cause. Is there a todo list with things that need to be done?

@hugopeek
Copy link

hugopeek commented Dec 9, 2020

@sepiariver I'm having these issues too and just tried installing your 2.0.1-dev package. Got it working after changing line 354 in Reductionist.php: $image->getFormat() was throwing a fatal error and changing it to $image->get('format') seems to work.

Still no luck with the webp images though.. How far along would you say this dev version is?

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

No branches or pull requests

4 participants