Jump to content

Search the Community

Showing results for 'webp'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. 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?
  2. 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. 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?
  4. I do have a follow-up question: Why is PHP GD and Imagick creation so slow when calling the frontend page? I have to add a lot of images to a PW project. When I add 2 images with 500kb file size, it takes almost 30 seconds to generate 8 WebP/JPEG variations. The Image-sizer log looks good to me: 2021-08-16 14:16:19 username /projekte/corporate-design-test… IMagick Resized: testimage.jpg => testimage.800x0se.jpg (800x0) 1.4486 secs 516332 => 78717 bytes (quality=75, sharpening=soft) 1 hour ago 2021-08-16 14:16:17 username /projekte/corporate-design-test… IMagick Resized: testimage.jpg => testimage.500x0se.jpg (500x0) 0.8468 secs 516332 => 37217 bytes (quality=75, sharpening=soft) 1 hour ago 2021-08-16 14:16:17 username /projekte/corporate-design-test… IMagick Resized: testimage.jpg => testimage.1920x1080se.jpg (1920x1080) 4.7528 secs 516332 => 307819 bytes (quality=75, sharpening=soft) Update: I have tested the site on a production server and image variants are created much faster than in MAMP.
  5. @netcarver Thanks. PW Error/Exception logs are empty. Once I hit reload, the Image-sizer log looks good to me. IMagick Resized: 1_portfoliologo.png => 1_portfoliologo.1500x0se.png (1500x0) 2.7099 secs 31021 => 49210 bytes (quality=75, sharpening=soft) I have enabled PHP/Apache debug log. But there are no error message besides [client ::1:51180] AH01964: Connection to child 11 established (server ___default___:443) [core:debug] [pid 1456] protocol.c(2338): [client ::1:51180] AH03155: select protocol from , choices=h2,http/1.1 for server pw-portfolio [ssl:debug] [pid 1456] ssl_engine_kernel.c(2351): [client ::1:51180] AH02043: SSL virtual host for servername pw-portfolio found [ssl:debug] [pid 1455] ssl_engine_kernel.c(2231): [client ::1:51179] AH02041: Protocol: TLSv1.2, Cipher: ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits) [Sun Aug 15 22:14:47.614382 2021] [ssl:info] [pid 1456] Update: I have removed the webP properties from the image fields. However I am still getting 500 Internal Server Error when I add 4-10 files to an image field. Image creating is working fine when I add 1 image, though. It looks like a MAMP specific limitation. Is there anything else I can look up? Not sure how can I debug this further.
  6. Hello, Adding more than 4 images to a repeater image field, Processwire crashes with 500 Internal Server Error. The Image file size is below 500 kb and ~2000px, 72dpi. Refreshing the page multiple times will generate and show the image variants at some point. There is no difference using GD or IMagick Image Sizer. Apache/PHP Logs does not show any errors. MAMP is set to 1024M memory_limit, max_execution_time 300 and upload_max_filesize 50MB. I guess this should be more than enough? Is this a PW or MAMP Pro issue? Any advised what is causing the Internal Server Error? Image Fieldtype settings: 'quality' => 75, 'upscaling' => true, 'cropping' => 'southeast' 4 JPEG image dimensions: 1920px, 1500px, 800px, 500px 4 webP image dimensions: 1920px, 1500px, 800px, 500px ProcessWire 3.0.165 MAMP Pro 6.4.2 Apache2.4 PHP7.4.16 I really appreciate any replies.
  7. Hi! I did a recent test and found the file size save from gif to webp was about 10x for comparable look. I tested using teh google CLI as linked above but wondered if it was possible to have the processwire $image->webp() method also produce a animated webp? I'm only getting static images out when tested... do I need to install something else on the server or are we not there yet?
  8. Not sure I understand correctly, but do you only need to have the width-200 image? You would need to call it like this: $page->images->first()->getCrop('portrait')->width(200)->webp->url; ALSO: If you already have called it once before, without the setting of "width=200", you have to forceNew=true or to removeVariations() before you call that. QUOTE: Is resizing still not working as mentioned in the first post of this topic? Will it work in a future release of CAI4? I don't understand this. Cannot find the post you mentioned also I'm not aware of resizing issues in general? All versions of CAI, (CAI2, CAI3, CAI4) have created resized variations. ??
  9. The readme of the Github repo says: I use this to generate a smaller version of a crop (for mobile), but the image doesn't get resized: $page->image_main->getCrop("panorama", "width=640")->webp->url; Is resizing still not working as mentioned in the first post of this topic? Will it work in a future release of CAI4?
  10. Hi @nbcommunication! First of all, thanks for this awesome module! I'm a user of PageimageSrcset too! I was wondering, how do you handle when webp's are larger in size than the original jpegs?? This happens to me far more often than I'd like to and sometimes it's more than double the size of the jpg image ? I went ahead and set useUrlOnSize option to true, though the source type attribute then it's kinda wrong although it seems to work just fine! Anyway, just wondering if you had come across a similar issue. Maybe it's worth being able to set the webp options in the render method?
  11. Having strange issues with this one as well. The field is 'body' and it has the TextformatterVideoEmbed option. On the same page, I have the YT URL in the page's body field. It outputs the URL. Below it, I have a Repeater Matrix field with the same body field and content and it outputs the video. Any ideas? Edit: I have found a cause but not the fix. My code is: <?php $featured = false; if ($page->hasField('images') && $page->images->count > 0) { $featured = $page->images->last; $description = !empty($featured->description) ? $featured->description : $page->get("headline|title"); } // ... ?> <?php if (!empty($page->body)) : ?> <div class="main__body owllob"> <?php if ($featured != false) : ?> <img class="main__feature-img" loading="lazy" src="<?=$featured->width(300)->webp()->url?>" alt="<?=$description?>" /> <?php endif; ?> <?=$page->body?> </div> <?php endif; ?> When I include a 'featured' image and even though it renders separately to the body field, the YT URL does not convert. When I delete the image, it does and the video shows/plays as expected???
  12. @wbmnfktryou are right. I totally forgot autosmush module. When turned off and webp enabled via hook it flies. Thanks mate!
  13. Is there anything else that may be the cause for the slow down? Only have 3.0.179 for tests on hand but just used exactly your code and only the initial load takes a bit longer as the webp needs to be created. Even older version (before 3.0.165) do very well with webp. Are there any errors or warnings in the logs? Anything else that shouldn't be? Any image or file modules in place?
  14. ProcessWire 3.0.165. PHP 7.2, 7.3 and 7.4 Tried webp like this but it slows down the pages for about 10 seconds and more. Tried cache, same result. <?= $page->images->eq(0)->size(500,300)->webp->url;
  15. WebP image support is great and works fine. But once created I've issues to get rid of all API generated WebP variations. The backend image field variations "Delete" works and I can remove all variations JPEG plus WebP. Image list is clean but all WebP API variations are still stored in file system (for instance files/12345/84.900x675.webp etc). I can only use ImageSizer with temp 'force' option to request fresh WebP variations or have to delete WebP files from folders. No other way so far. Tested with 2 sites and latest master PW 3.0.165. Is there somewhere a "magic button" or config/setup thing to solve my sticky WebP issue?
  16. HI @eelkenet, I have setup a new test site today and it looks that any possible setting is working as expected from the PW image generation site. So it seems I need some more information from your setup. Especially this: what settings are you using for $config->imageSizerOptions ? what are the settings for $config->webpOptions ? how do you call the image url in your template file(s) with $image->size()->webp->url or $image->size()->url, or how? do you use an individually passed options array there? what are your settings in the .htaccess file ? Please can you provide these information as exact as possible. If you don't want to post this here you can PM me. My newly set up testing, without any settings in the .htaccess doesn't recreate any variations. It looks like this:
  17. Hello @eelkenet, I had that issue on my local MAMP server, when this feature was introduced. I tried this config option, but for me it doesn't work at all. Is it mandatory to edit your .htaccess? Because strategies 1 and 2 didn't work for me, I use strategy 3 with an own config variable ($config->useWebP) and disable WebP on my local MAMP server. Regards, Andreas
  18. Today I again bumped into an issue I had last year with creating WebP images: Enabling WebP on another project by setting imageSizerOptions' webpAdd to true immediately resulted in the same behaviour as I had last year: the server simply keeps on creating new variations of images, while they already exist. WebP images are created correctly by the way. Seems to be a bug, can anybody else confirm? I am using PW Master (3.0.165) on MAMP Pro (MacOS 11.2, PHP 7.4.2)
  19. I'm not totally following what you are doing, but sessioningerprinting should not be an issue if you look at my code the post above with using php function getallheaders() This allows a complete 1:1 copy of the sended headers from the browser also through wirehttp. It includes the same UA header, same cookies, same everything. array(12) { ["Host"] string(32) "pw-change-default-language.local" ["Connection"] string(10) "keep-alive" ["Upgrade-Insecure-Requests"] string(1) "1" ["User-Agent"] string(132) "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36 OPR/75.0.3969.149" ["Accept"] string(135) "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" ["Sec-Fetch-Site"] string(4) "none" ["Sec-Fetch-Mode"] string(8) "navigate" ["Sec-Fetch-User"] string(2) "?1" ["Sec-Fetch-Dest"] string(8) "document" ["Accept-Encoding"] string(17) "gzip, deflate, br" ["Accept-Language"] string(35) "de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7" ["Cookie"] string(166) "wire=8jfqut56c2ag66iaquvb27jdpu; wire_challenge=72ie9BYKDjbw4h0%2FhBYu1wmngAyUoA3F; wires=5u0b7v49ecudnj39bmdpat4dje; wires_challenge=TmFvvRVgTxBQYsyta4tST6yQJjkzymPd" }
  20. I've been meaning to revise PageimageSrcset for a while now, to remove some features that I felt were unnecessary and to implement a better rendering strategy. The result is PageimageSource. What does it do? It provides a configurable srcset method/property for Pageimage It allows WebP to be enabled for images it generates. It allows Pageimage:render() to return a <picture> element It provides a Textformatter that replaces <img> elements with the output of Pageimage:render() Although it is based on a current module, this should still be considered beta and not used in production without a prior development stage. Here's the README: PageimageSource Extends Pageimage with a srcset property/method plus additional rendering options. Overview The main purpose of this module is to make srcset implementation as simple as possible in your template code. For an introduction to srcset, please read this Mozilla article about responsive images. Installation Download the zip file at Github or clone the repo into your site/modules directory. If you downloaded the zip file, extract it in your sites/modules directory. In your admin, go to Modules > Refresh, then Modules > New, then click on the Install button for this module. ProcessWire >= 3.0.165 and PHP >= 7.3 are required to use this module. Configuration To configure this module, go to Modules > Configure > PageimageSource. Default Set Rules These are the default set rules that will be used when none are specified, e.g. when calling the property: $image->srcset. Each set rule should be entered on a new line, in the format {width}x{height} {inherentwidth}w|{resolution}x. Not all arguments are required - you will probably find that specifying the width is sufficient for most cases. Here's a few examples of valid set rules and the sets they generate: Set Rule Set Generated Arguments Used 320 image.320x0-srcset.jpg 320w {width} 480x540 image.480x540-srcset.jpg 480w {width}x{height} 640x480 768w image.640x480-srcset.jpg 768w {width}x{height} {inherentwidth}w 2048 2x image.2048x0-srcset.jpg 2x {width} {resolution}x How you configure your rules is dependent on the needs of the site you are developing; there are no prescriptive rules that will meet the needs of most situations. This article gives a good overview of some of the things to consider. When you save your rules, a preview of the sets generated and an equivalent method call will be displayed to the right. Invalid rules will not be used, and you will be notified of this. WebP If enabled, WebP versions of the image and srcset variations will be generated and these will be returned by Pageimage::srcset(). As with the default implementation, the image with the smaller file size is returned. In most cases this is the WebP version, but sometimes can be the source. Make sure to experiment with the quality setting to find a value you find suitable. The default value of 90 is fine, but it is possible that lower values will give you excellent kB savings with little change in overall quality. For more information on WebP implementation please read the blog posts on the ProcessWire website. Rendering These settings control how the output of Pageimage::render() is modified. Use Lazy Loading? When enabled this adds loading="lazy" to the <img> attributes. It is useful to have this on by default, and you can always override it in the options for a specific image. Use the <picture> element? When enabled, the <img> element is wrapped in a <picture> element and <source> elements for original and WebP variations are provided. This requires WebP to be enabled. For more information on what this does, have a look at the examples in Pageimage::render() below. Remove Variations If checked, the image variations generated by this module are cleared on Submit. On large sites, this may take a while. It makes sense to run this after you have made changes to the set rules. Please note that although the module will generate WebP versions of all images if enabled, it will only remove the variations with the 'srcset' suffix. Usage Pageimage::srcset() // The property, which uses the set rules in the module configuration $srcset = $image->srcset; // A method call, using a set rules string // Delimiting with a newline (\n) would also work, but not as readable $srcset = $image->srcset('320, 480, 640x480 768w, 1240, 2048 2x'); // The same as above but using an indexed/sequential array $srcset = $image->srcset([ '320', '480', '640x480 768w', '1240', '2048 2x', ]); // The same as above but using an associative array // No rule checking is performed $srcset = $image->srcset([ '320w' => [320], '480w' => [480], '768w' => [640, 480], '1240w' => [1240], '2x' => [2048], ]); // The set rules above are a demonstration, not a recommendation! Image variations are only created for set rules which require a smaller image than the Pageimage itself. This may still result in a lot of images being generated. If you have limited storage, please use this module wisely. Pageimage::render() This module extends the options available to this method with: srcset: When the module is installed, this will always be added, unless set to false. Any values in the formats described above can be passed. sizes: If no sizes are specified, a default of 100vw is assumed. lazy: Pass true to add loading=lazy, otherwise false to disable if enabled in the module configuration. picture: Pass true to use the <picture> element, otherwise false to disable if enabled in the module configuration. Please refer to the API Reference for more information about this method. // Render an image using the default set rules // WebP and lazy loading are enabled, and example output is given for <picture> disabled and enabled echo $image->render(); // <img src='image.webp' alt='' srcset='image.jpg...' sizes='100vw' loading='lazy'> /* <picture> <source srcset="image.webp..." sizes="100vw" type="image/webp"> <source srcset="image.jpg..." sizes="100vw" type="image/jpeg"> <img src="image.jpg" alt="" loading="lazy"> </picture> */ // Render an image using custom set rules echo $image->render(['srcset' => '480, 1240x640']); // <img src='image.webp' alt='' srcset='image.480x0-srcset.webp 480w, image.1240x640-srcset.webp 1240w' sizes='100vw' loading='lazy'> /* <picture> <source srcset="image.480x0-srcset.webp 480w, image.1240x640-srcset.webp 1240w" sizes="100vw" type="image/webp"> <source srcset="image.480x0-srcset.jpg 480w, image.1240x640-srcset.jpg 1240w" sizes="100vw" type="image/jpeg"> <img src="image.jpg" alt="" loading="lazy"> </picture> */ // Render an image using custom set rules and sizes // Also use the `markup` argument // Also disable lazy loading // In this example the original jpg is smaller than the webp version echo $image->render('<img class="image" src="{url}" alt="Image">', [ 'srcset' => '480, 1240', 'sizes' => '(min-width: 1240px) 50vw', 'lazy' => false, ]); // <img class='image' src='image.jpg' alt='Image' srcset='image.480x0-srcset.webp 480w, image.1240x0-srcset.webp 1240w' sizes='(min-width: 1240px) 50vw'> /* <picture> <source srcset="image.480x0-srcset.webp 480w, image.1240x0-srcset.webp 1240w" sizes="(min-width: 1240px) 50vw" type="image/webp"> <source srcset="image.480x0-srcset.jpg 480w, image.1240x0-srcset.jpg 1240w" sizes="(min-width: 1240px) 50vw" type="image/jpeg"> <img class='image' src='image.jpg' alt='Image'> </picture> */ // Render an image using custom set rules and sizes // These rules will render 'portrait' versions of the image for tablet and mobile // Note the advanced use of the `srcset` option passing both `rules` and image `options` // WebP is disabled // Picture is disabled echo $image->render([ 'srcset' => [ 'rules' => '320x569, 640x1138, 768x1365, 1024, 1366, 1600, 1920', 'options' => [ 'upscaling' => true, 'hidpi' => true, ], ], 'sizes' => '(orientation: portrait) and (max-width: 640px) 50vw', 'picture' => false, ]); // <img src='image.jpg' alt='' srcset='image.320x569-srcset-hidpi.jpg 320w, image.640x1138-srcset-hidpi.jpg 640w, image.768x1365-srcset-hidpi.jpg 768w, image.1024x0-srcset-hidpi.jpg 1024w, image.1366x0-srcset-hidpi.jpg 1366w, image.1600x0-srcset-hidpi.jpg 1600w, image.jpg 1920w' sizes='(orientation: portrait) and (max-width: 768px) 50vw' loading="lazy"> TextformatterPageimageSource Bundled with this module is a Textformatter largely based on TextformatterWebpImages by Ryan Cramer. When applied to a field, it searches for <img> elements and replaces them with the default output of Pageimage::render() for each image/image variation. Assuming a default set of 480, 960 and lazy loading enabled, here are some examples of what would be returned: Example <figure class="align_right hidpi"> <a href="/site/assets/files/1/example.jpg"> <img alt="" src="/site/assets/files/1/example.300x0-is-hidpi.jpg" width="300" /> </a> </figure> WebP enabled <figure class="align_right hidpi"> <a href="/site/assets/files/1/example.jpg"> <img alt="" src="/site/assets/files/1/example.300x0-is-hidpi.webp" width="300" srcset="/site/assets/files/1/example.300x0-is-hidpi.webp 480w" sizes="100vw" loading="lazy" /> </a> </figure> <picture> enabled <figure class="align_right hidpi"> <a href="/site/assets/files/1/example.jpg"> <picture> <source srcset="/site/assets/files/1/example.300x0-is-hidpi.webp 480w" sizes="100vw" type="image/webp"> <source srcset="/site/assets/files/1/example.300x0-is-hidpi.jpg 480w" sizes="100vw" type="image/jpeg"> <img alt="" src="/site/assets/files/1/example.300x0-is-hidpi.jpg" width="300" loading="lazy" /> </picture> </a> </figure> Because the variation is small - 300px wide - the srcset only returns the source image variation at the lowest set width (480w). If the source image was > 1000px wide, there would be a variation at both 480w and 960w. PageimageSrcset This module is built upon work done for PageimageSrcset, which can be considered a first iteration of this module, and is now deprecated. Migration PageimageSource is a simplified version of PageimageSrcset with a different approach to rendering. Most of the features of the old module have been removed. If you were just using $image->srcset(), migration should be possible, as this functionality is essentially the same albeit with some improvements to image variation generation.
  21. I would recommend using the third WebP strategy for that. ?
  22. Hi, cool site! One thing though – Safari (14.0.3) doesn't support .webp and all nice images are not visible ?
  23. @Sanyaissues I see that there is used GD for the creation of the image variations, (at least some). Please, can you tell me which value you use(d) for "defaultGamma" in your $config->imageSizerOptions (or optional a options array passed to the variation creation)? BTW, the image handling is perfect! Different source sets for landscape and portrait orientation, (native) lazy loading, WebP variations with jpeg/png fallback, - everything is in! ? ? If you or the artist is interested in protecting the original images (the high quality 2000px ones) you may embed a .htacess snippet and the admin-image-proxy php from here.
  24. Hi, after the update from the 3.0.123 to the 3.0.164 I have some problem: The website start to be really slow and the server often go in times out with error 500. The different in performance was about 5/6s of TTFB. I try a lot of different things to recover speed and no longer have the error. In the end we went back to the previous version and everything worked better. On the 3.0.164 version I notice this error that maybe they can help to understand the reason for the problem with the update: Analyzing the site with the help of the server provider we found that: the index page make a lot of executions, was 38737 in 1 day. This is to very much for the traffic that we have, in the same day our IP is run 23206 call, that look impossible. I'm not sure the problem is about those things, I also the server use nginx, maybe could be this. At moment we will keep using the 3.0.123 version, but I would like to make the upgrade to use the new API. Someone can help me to understand why the site has become slow? UPDATE I tried to load version 3.0.148, but still I notice a slowdown of the site. The TTFB grow from 2.8 to 6.3 Someone know if there is a way to use the webp format for version 3.0.123 as well?
  25. I've just discovered this module and am unable to get any images to show from it. My setup is on localhost using php 7.3, PW 3.0.165 with lazysizes. The code in my template is: if($page->main_image) echo "<img data-srcset='$page->main_image->srcset('1500x1000,/2,/3,*1.5')' class='mainimageH' data-sizes='auto' alt='$page->headline'>"; No image is shown and the output I get is: <img data-srcset='pnz007n.jpg->srcset('1500x1000,/2,/3,*1.5')' class='mainimageH' data-sizes='auto' alt='sunset at Lake Tekapo on the South Island of New Zealand'> My guess is it is something simple that I'm missing ? I too would really like to see this support WebP.
×
×
  • Create New...