greenrivers / grav-plugin-webp

Grav Webp plugin.
MIT License
11 stars 0 forks source link

Plugin don't convert all images bug #6

Closed danielkoptak closed 1 year ago

danielkoptak commented 1 year ago

When I run convert, it can handle most of the images up to the last 605 images (I have about 3600 images). In request is displayed converted_images:0 and so the whole process is looped image

MajorKuprich commented 1 year ago

Hi @danielkoptak,

Unfortunately I can't reproduce this error. I've tested with 3500 images in my environment - most of them converted to webp format.

Could You give me more info about:

In case any problems with large amount of images to processing You can refresh page and click on the convert button again.

Regards

danielkoptak commented 1 year ago

Grav v1.7.37.1 PHP Version 7.4.32 max_execution_time 90 max_input_time 60 memory_limit 2048M

if i refresh the page then i see: Converted 0/605 image - but nothing happens. It looks like one of the images is causing problems when converting. Is there a way to find out the name of the image that is being converted? (console output...)

MajorKuprich commented 1 year ago

Hello @danielkoptak,

PHP config looks fine.

You can preview the image data by adding code fragment at the beginning of the convert function, before this line: https://github.com/greenrivers/grav-plugin-webp/blob/master/classes/Helper/Converter.php#L34.

  1. View image data & stop conversion - preview available from browser console.
        var_dump($image);
        exit();

    When You start conversion, the process stops at the first image - then You can preview its data. It should be the image that blocks the conversion of the other files.

E.g. for ChromeNetwork tab, convert request:

chrome

  1. Logging for each image.
        $log = \Grav\Common\Grav::instance()['log'];
        $log->info('Image: ' . json_encode($image));

    Logs available in logs/grav.log

Example log:

[2022-10-18 17:55:56] grav.INFO: Image: {"extension":"jpg","pathname":"user\/themes\/greenrivers\/images\/desktop_home.jpg","pathinfo":{"pathname":"user\/themes\/greenrivers\/images"},"filenamewithoutextension":"desktop_home"} [] []

Please let me know if you have any further questions.

MajorKuprich commented 1 year ago

It has been over 2 months since last activity in this topic, so I close this issue. Reopen or create new ticket if You need more explanations, please. :)