benbyf Posted August 17, 2021 Share Posted August 17, 2021 Tested on PW 3.0.148 on the image field and the site is able to upload and present the webp image on the front end, but in the admin I get a blank transparent image with the warning [image url].webp - not a supported image type Just wondered if the image field in new PW versions had a fix for this or not? Link to comment Share on other sites More sharing options...
horst Posted August 17, 2021 Share Posted August 17, 2021 Yes, webp only is an output format, not a source image or master image format. If you want to use only webp as original image and output image (WITHOUT resize methods) you can use it within a files field. Within image fields is not supported and doesn't make much sense. 3 1 Link to comment Share on other sites More sharing options...
benbyf Posted August 17, 2021 Author Share Posted August 17, 2021 Hi @horst thanks for getting back! I guess I have a very specific use case. My client uses a lot of gif’s which are bloating the front end… been migrating most images to webp and found that webp also does animation. Did a quick test and found a webp animation was roughly 10x smaller than the small gif. woudl love to allow my clients to upload and view in the admin as they do a lot of arranging of images. However, encoding an image to webp doesn’t keep any animations on the server (also the quality is worse going from giff to webp instead of jpg slides to webp). I guess I can’t see any reason why if presented with a webp upload the image field couldn’t just display as is in the backend… or maybe toggle this on in settings? 1 Link to comment Share on other sites More sharing options...
horst Posted August 17, 2021 Share Posted August 17, 2021 6 minutes ago, benbyf said: I guess I can’t see any reason why if presented with a webp upload the image field couldn’t just display as is in the backend This is by design, because we have jpeg, gif and png as master images that can be used as originals for resizing, cropping, etc. and from the final variations optionally a webp can be created. The webp is called upon an regular page image object: $image->webp()->url. We would need a new Fieldtype or Inputfield for images only to collect and arrange images, without modifying methods. This could be able to support other file formats too. (TIFF, BMP or others maybe). But with the current image field, webp can't be handled as original image format. It's by design. Maybe an extention of the file field, that creates and displays a thumbnail additionally to the filename(s) would help? Link to comment Share on other sites More sharing options...
horst Posted August 17, 2021 Share Posted August 17, 2021 18 minutes ago, benbyf said: However, encoding an image to webp doesn’t keep any animations on the server (also the quality is worse going from giff to webp instead of jpg slides to webp). I read something about better using ffmpeg and create videos from animated gifs. But I haven't done anything about it until now. If you are interested, it was in a book from Adi Osmani: Image Optimization My son uses ffmpeg a lot on CLI on linux. It's on my wish list to investigate further, but time is rare. Link to comment Share on other sites More sharing options...
benbyf Posted August 18, 2021 Author Share Posted August 18, 2021 sure, I use webm and mp4's where i can, just be nice to use images OR have some good way of dropping hundreds of images onto a page, re arrange them and add videos in the same area... which ultimately is my issue. Repeaters are good option but theres no way to quickly make LOTs of repeaters with drag and drop files... I think the best solution for me would be able to drop a load of files into a field and for it to populate a repeater filled with the same number of items filling the first image or file field it fields on each new item... Link to comment Share on other sites More sharing options...
benbyf Posted August 18, 2021 Author Share Posted August 18, 2021 ok I think i've solved it. gonna use https://packery.metafizzy.co/ and do the arrangement in the frontend for logged in users instead, (this means it'll be easier to mix media types and just save an order somewhere for that page)....., ? fingers crossed 2 Link to comment Share on other sites More sharing options...
bernhard Posted January 12, 2022 Share Posted January 12, 2022 On 8/17/2021 at 7:15 PM, horst said: But with the current image field, webp can't be handled as original image format. It's by design. Hey @horst why is that by design? I don't understand why we should not be allowed to upload webp directly if we want to display webp afterwards? Link to comment Share on other sites More sharing options...
interrobang Posted March 7, 2023 Share Posted March 7, 2023 I have more and more customers complaining that they can't upload webp images. I understand that webp is not the ideal master image format, but neither is jpeg. The webp browser support is also so good now that it would not be necessary to generate jpeg/png versions from webp. 4 Link to comment Share on other sites More sharing options...
Robin S Posted March 8, 2023 Share Posted March 8, 2023 For those who just want to let users upload WEBP format and are looking for a workaround, here is a simple module that converts WEBP to JPG on upload: I wonder though... how is it that the user acquired the WEBP image in the first place? Surely they didn't just pinch it off somebody else's website... ? 5 1 Link to comment Share on other sites More sharing options...
Smirftsch Posted November 28, 2023 Share Posted November 28, 2023 Sorry to catch up this older topic again, but there seems to be no changes in sight so far. I also still would find it useful to have webp as input format. The need- or the wish- to use it, is from my experience originated in Google requesting (or recommending) webp format in order to reduce loading times when doing speed tests with lighthouse. So people start to use and store images in webp format. Then to convert them back to jpg or png just to output these as webp again makes no sense at all. 3 Link to comment Share on other sites More sharing options...
d'Hinnisdaël Posted November 28, 2023 Share Posted November 28, 2023 I can't quite see how WEBP images are different from JPEGs or GIFs in this regard, and why they shouldn't be allowed as source images. All these formats are lossy and have the potential to look fantastically terrible when set to high compression rates, so there's really no ideal input format apart from TIFFs and lossless PNGs. The browser and OS support of WEBPs is such that we should allow them as source format if the server is configured to resize them. From what I've seen, most GD and Imagick installations these days handle WEBP just fine. With websites now outputting WEBP files, a growing number of PW users will expect to keep working with them as they've always been working with other common formats. 3 Link to comment Share on other sites More sharing options...
bernhard Posted March 11 Share Posted March 11 Hey @horst and @Robin S here is a real use case from today: A website mockup with transparent background. Exporting it as PNG results in 369kB: WEBP 109kB WEBP created from PNG via PW: 66kB That seems to be a 90% quality setting ? @Robin S is there a reason why your module converts to JPG and not PNG? I'd lose the transparency when using JPG... I guess I export PNG and use that for my website for now, but I'd still think that it would be nice to support WEBP @horst maybe you can rethink that? Link to comment Share on other sites More sharing options...
Ushavilash Posted March 13 Share Posted March 13 Hello @benbyf, You can update to the latest version of PW. If that doesn't solve the problem, convert the WebP images to a supported format like JPEG or PNG for admin use and for compressing them you can use any online application such as https://jpegcompressor.com/ it compresses JPEG, PNG and other. 1 Link to comment Share on other sites More sharing options...
benbyf Posted March 13 Author Share Posted March 13 1 hour ago, Ushavilash said: Hello @benbyf, You can update to the latest version of PW. If that doesn't solve the problem, convert the WebP images to a supported format like JPEG or PNG for admin use. Thanks for your help, but not sure thats the issue. I will however check the latest version of PW to check support and report back Link to comment Share on other sites More sharing options...
Ushavilash Posted March 15 Share Posted March 15 okay that's great. Link to comment Share on other sites More sharing options...
applab Posted May 23 Share Posted May 23 Has thinking around this issue changed at all? Support for .webp as an upload format for images would be a game-changer for my current project (and has been requested by several previous clients). On 3/7/2023 at 5:14 PM, interrobang said: I have more and more customers complaining that they can't upload webp images. I understand that webp is not the ideal master image format, but neither is jpeg. The webp browser support is also so good now that it would not be necessary to generate jpeg/png versions from webp. On 11/28/2023 at 2:36 PM, Smirftsch said: Sorry to catch up this older topic again, but there seems to be no changes in sight so far. I also still would find it useful to have webp as input format. The need- or the wish- to use it, is from my experience originated in Google requesting (or recommending) webp format in order to reduce loading times when doing speed tests with lighthouse. So people start to use and store images in webp format. Then to convert them back to jpg or png just to output these as webp again makes no sense at all. On 11/28/2023 at 10:19 PM, d'Hinnisdaël said: I can't quite see how WEBP images are different from JPEGs or GIFs in this regard, and why they shouldn't be allowed as source images. All these formats are lossy and have the potential to look fantastically terrible when set to high compression rates, so there's really no ideal input format apart from TIFFs and lossless PNGs. The browser and OS support of WEBPs is such that we should allow them as source format if the server is configured to resize them. From what I've seen, most GD and Imagick installations these days handle WEBP just fine. With websites now outputting WEBP files, a growing number of PW users will expect to keep working with them as they've always been working with other common formats. 2 Link to comment Share on other sites More sharing options...
applab Posted June 6 Share Posted June 6 Ok, so I decided to scratch my own itch on this one... I need to handle WebP's which include transparent regions so I've created a modified version of the @Robin S module (https://processwire.com/modules/webp-to-jpg/) but which allows you to choose between PNG or JPEG as the target format. https://gitlab.com/applab/pw-uploadwebp 5 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now