• I can’t get the plugin to work on a website. It works on another website that is on the same server but in a different cPanel account. I can’t figure out what the issue is here.

    It’s a LiteSpeed server with these Conversion method:
    – ImageMagick
    – cwebp
    – GraphicsMagick
    – Gd extension

    Below is what I get when I run the live tests.

    Enable direct redirection to existing converted images?
    ? all works fine

    Enable redirection to converter?
    ? this error:

    Response headers:
    – x-webp-express-error: Error occured while calculating destination path: Image type could not be detected

    Body:
    Error occured while calculating destination path: Image type could not be detected
    However. As the “content-type” header reveals, we did not get a webpSurprisingly we got: “text/html; charset=UTF-8”
    The test FAILED.
    Deleting test images

    Create webp files upon request?
    ? this error

    Response headers:
    – x-webp-express-error: Error occured while calculating destination path: webp-realizer.php need to know the file path and cannot simply use $_SERVER[“REQUEST_URI”] as that points to itself rather than the image requested. On Nginx, please add: “&xdestination=x$request_filename” to the URL in the rules in the nginx config (sorry, the parameter was missing in the rules in the README for a while, but it is back)

    Any idea what could be wrong and how I can fix it?

    Thank you!
    JP

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Can you have a look at this please @roselldk ?

    Thanks
    JP

    Plugin Author rosell.dk

    (@roselldk)

    It seems the problem is that the image type of the image you are trying to convert cannot be determined. For security reasons, webp-convert, which WebP Express uses for converting will abandon when it cannot verify that it is an image it is going to convert.

    But I’m very surprised that this happens. webp-convert is using a library, image-mime-type-guesser, for detecting the mime type. image-mime-type-guesser has been well tested and should definitely not fail detecting a jpeg. I have added the jpeg that the self-test in WebP Express uses (very-small.jpg) to the unit testing in image-mime-type-guesser and it has no problems detecting it as a image/jpeg.

    image-mime-type-guesser uses image-mime-type-sniffer as one of the methods of detecting mime type. That method does not rely on server setup. It does not detect all image signatures, but it does recognize jpeg.

    So… I’m baffled!

    • This reply was modified 2 years, 6 months ago by rosell.dk.

    Thank you for looking into this Rosell.

    I looked into it again and in the end I fixed it by removing the main .htaccess file and let it recreate by re-save the permalinks. Then it worked.

    After that I also resaved the WordFence and Litespeed cache settings (as they add stuff to .htaccess) and then I added all my redirects and other items I want to have in there again. It still worked.

    Then I followed the same procedure on another site where I had the same issue and it solved it there too.

    So there was an issue with .htaccess. I compared the old and new .htaccess but couldn’t find something that could have caused it.

    In any case, it’s solved and I learned another step for fixing weird behaviour.

    Thanks
    JP

    Plugin Author rosell.dk

    (@roselldk)

    Ok.

    In the meantime, I have been digging into how the mime type dectection can fail and found something. When the image-mime-type-guesser library fails to sniff the file type, it falls back to guessing from file extension. That part of the code was failing in this case, because it wasn’t case insensitive. I’m going to fix that: https://github.com/rosell-dk/image-mime-type-guesser/issues/27

    Cool thanks!

    I think in my case it was really an issue in my htaccess. If that was the case sensitive issue it I suppose the test would pass and at least some images would have been converted.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Error occured while calculating destination path: Image type could not be detect’ is closed to new replies.