Support » Plugin: Participants Database » WebP image

  • Resolved tigre19

    (@tigre19)


    Hi! First, thank you for your wonderful plugin very complete and very clear. I love it and I congratulate you for such an awesome work, free of charge.
    As wordpress now reads webp images, how to upload webp images?
    Only jpg,jpeg,gif,png extensions work.
    I added .webp in Configuration / General settings / Allowed file types, but then when I choose a file, the image.webp is not taken.
    Thank you for your reply,
    Kael

    • This topic was modified 7 months, 3 weeks ago by tigre19.
Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author xnau webdesign

    (@xnau)

    I just tested this and webp images are supported. You have the file type enabled in the global “Allowed File Types” setting, that is necessary.

    You must also check the field definition for an “allowed” setting in the field attributes, it must either be blank, or if there are extensions in the setting, “webp” should be included in that.

    If that is OK and you’re still unable to upload a webp file, please provide a detailed description of what you’re seeing when you attempt the upload.

    Thread Starter tigre19

    (@tigre19)

    Thank you for your quick reply, it does not work.
    Here is the content of my field “Allowed file types” (in General setting) : txt,pdf,mp3,mp4a,ogg,doc,docx,odt,rtf,zip,jpg,jpeg,gif,png,webp
    I have already added webp

    And in my image upload form, here is the content of the field “Attribute” :
    allowed::
    It’s empty

    When I upload a transparent 32-bit png image, I click on Apply and the image appears. It’s ok. But when I upload a transparent 32 bit webp image, I click on Apply and it always written “No file chosen”
    (I translate in English because my plugin is in French)

    To check, I tried this:
    allowed::webp
    webp does not work. png no longer works.
    I tried this:
    allowed::webp|png or also allowed::png|webp
    webp does not work. pnp works again.
    And that ;
    allowed::webp|png|gif
    png and gif are ok. webp does not work
    And if I try a image.jpg, i have the message “The file selected must be one of these types: png, webp, gif.”.It’s normal, but webp doesn’t work

    Also I don’t understand. If you have a suggestion, it is welcome, thank you so much.
    I add that I already regularly use webp images in wordpress.
    Kael

    Plugin Author xnau webdesign

    (@xnau)

    It says “no file chosen” after trying to upload a webp, but is there any error message?

    Thread Starter tigre19

    (@tigre19)

    Yes, above:
    For “Perfume Image”, you can only upload image files like jpeg, gif or png.
    Here is a screenshot of the steps:
    https://bysymrise.com/members/webp-screenshots.jpg
    The webp extension added in Attribute is not taken into account
    The other 3 are working.

    To test, I put an image.webp on the server in the “participants-database” folder. And I put his name directly in the field on phpmyadmin.
    The plugin reads image.webp very well.
    So the problem is only in the upload form.

    • This reply was modified 7 months, 3 weeks ago by tigre19.
    • This reply was modified 7 months, 3 weeks ago by tigre19.
    Plugin Author xnau webdesign

    (@xnau)

    Thanks. Are you using the latest version of Participants Database? Nothing about this changed recently, but I just want to make sure we’re talking about the same code.

    What I see in your screenshots looks like the setting is correct, so have you cleared your server cache? The reason I say this is because the error message you’re seeing is the one that is displayed if there is no “allowed” setting in the field definition, so it looks like the setting is not getting read correctly.

    Thread Starter tigre19

    (@tigre19)

    Hi, yes I am using the latest version 2.1.5 and there I cleared the cache to check. Same error message.
    Thanks

    Thread Starter tigre19

    (@tigre19)

    PS : Maybe the number of letters of the webp extension in the Attribute field. 4 letters not 3

    Plugin Author xnau webdesign

    (@xnau)

    OK, I have to apologize, I tested this with the Image Expansion add-on enabled, and when I try it without that add-on enabled it also fails for me.

    I forgot that it is necessary to use this add on to use webp because then images are imported into the WP media library which handles webp files.

    Plugin Author xnau webdesign

    (@xnau)

    I’m looking at fixing this so the add-on isn’t needed.

    Plugin Author xnau webdesign

    (@xnau)

    It looks like Participants Database isn’t set up to recognize webp as a valid image file. This is mostly an oversight as the plugin is much older than the webp format. When webp became a widely supported format, I didn’t notice that it wasn’t supported because of my use of the Image Expansion add-on.

    You can edit Participants Database to accept webp files by making this change.

    In the plugin file classes/xnau_Image_Handler.php on line 663, you’ll see:

    $valid_image = preg_match( '/(gif|jpeg|png)/', mime_content_type( $file ) ) === 1;

    change that to:

    $valid_image = preg_match( '/(gif|jpeg|png|webp)/', mime_content_type( $file ) ) === 1;

    and webp files will be accepted.

    Thread Starter tigre19

    (@tigre19)

    OK, that’s wonderful. That works !
    Webp images are generally 1/3 less heavy. But for 32-bit transparent png it is between 5 and 10 times less heavy with 32-bit transparent webp. It is therefore a considerable advantage.

    Thank you for taking the time to resolve this problem so quickly. Being able to download webp images will undoubtedly help a lot of people

    I wish you many new successes with this beautiful plugin.
    Thanks a lot to you šŸ™‚
    Kael

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘WebP image’ is closed to new replies.