Jump to content

matjazp

Members
  • Posts

    685
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by matjazp

  1. Yeah, your' right, it calls collapse() that in turn calls markupToText() but with own options. Would it help if you try keepTags/keepFormatTags option?
  2. Try (untested): $text = wire('sanitizer')->truncate($item->body, 200, array('underlineHeadlines' => false));
  3. I'm using it in a production (PW 3.0.104) for years, I thinks in it's basic (original) version, no problem so far. I'm not merging multiple js/css with AIOM, I do it by hand. Give it a try, you may even want to try my forked version, and if it doesn't work for you, the solution is ProCache. If the client have no money, then it's ok, PW will work out of the box too. And, nowadays internet connections are fast enough so that minimizing for every cost is not so important (that's my opinion).
  4. Yeah. Maybe simple text like "80% smaller" or "20% larger" would make more sense. Or maybe no info at all. I'm also confused with the word "Original"...
  5. Is it just me who don't understand the percentage for the webp generated variation? Original is 311k, webp is 62k, how do I get 80% ? That means webp is 80% smaller than original? And if webp is bigger than original, I get (webp -20%). And while here, how do I delete webp variation?
  6. I'm getting this error too but it doesn't go away. I had to change static public function getModuleConfigInputfields(array $data) to public function getModuleConfigInputfields($data)
  7. I think thats PW core problem, see https://github.com/processwire/processwire-issues/issues/979
  8. @ryan @dragan I can confirm the problem is in AOS. It's an easy fix for @tpr.
  9. I can confirm. It looks like processInput is not executed if Yes is checked.
  10. That error comes from ProcessFileEdit.js when file is saved. I'm testing on PW 3.0.140 and its saving. Any hints in browser dev console? Could you try reverting .htaccess file back to the working version?
  11. Hm, I see 3: I don't do PRs as they are not accepted. Ryan finds his way of fixing it.
  12. @thetuningspoon mind testing with attached PagerNav.php? Possibly not perfect, but it's not clear to me how pagination should be presented on edge cases... PagerNav.php
  13. Please try this version, check the box under advanced options. AutoSmush.zip
  14. I usually decide if I want to keep exif or not when the image is prepared for upload. But I see your point. It's possible to add an option, but I'm quite busy these days and then I'm off to a vacation... I'm not sure if this module has a potential now that we have webp?
  15. Hm, the intended purpose for the image (regardless of the format) is to be displayed on the screen, no? How is webp different in that context? Noted.
  16. Why not? Why is webp treated only as variation and not as other "normal" image? I added this to /site/config.php: $config->hasWebpSupport = (strpos($_SERVER['HTTP_ACCEPT'], 'image/webp') !== false); $config->imageSizerOptions = array_merge($config->imageSizerOptions, array( 'webpAdd' => true )); And in my template: $img = $page->images->first(); $url = ($config->hasWebpSupport && $img->hasWebp) ? "urlWebp" : "url"; echo "<a href='{$img->$url}'>{$img->$url}</a>"; // this is actually php implementation of .htaccess rules Then I uploaded image.jpg and found out that webp is generated only for admin thumbs and not for my uploaded image. I don't want to call size() as my uploaded image is already the way I wanted, I just need webp. Is this unsupported situation? Why do we need webp as admin thumb? I added: $config->adminThumbOptions = array_merge($config->adminThumbOptions, array( 'webpAdd' => false )); and that fixed admin thumb webp creation, but of course there is no webp image. I then manually copied image.webp to the folder where image.jpg was uploaded and this time the image was correctly displayed in Chrome (that has webp support) and in IE (that lacks webp support). Maybe you could add another property to the image that would return the correct URL as in my template file? Should webp extension be listed in /wire/config.php on $config->fileContentTypes?
  17. Maybe the most reliable way is: $webpsupport = (strpos($_SERVER['HTTP_ACCEPT'], 'image/webp') !== false); if($webpsupport) { //serve webp } else { //serve jpg or png or whatever } Of course, .htaccess is a viable solution...
  18. Yes, there are [OR] conditions in htaccess.txt, but they are all [OR], not a mixture of [OR] and [AND]. I understand that, but how would .htacces know if image.webp is "made" from image.png or image.jpg? How would you decide which one is first? Also, when I upload image.webp I get "Pageimage: castle.0x260.webp - not a supported image type"
  19. I can't make this work on IIS as I don't know if mixed conditions are supported, as far as I know, you can either MatchAny or MatchAll. It will work If I omit the last rule and use MatchAny (IIS fans?). But, how would we know what to serve to the browser if webp is either unsupported or doesn't exist, .jpg or .png or even something else?
  20. It's working here on Windows and IIS 8.5
  21. I'm using DynamicRoles in production on two sites to allow users with specific roles to edit specific page(s). I started with PW 2.4.x, when I upgraded to PW 3, I had to modify the module by adding the namespace to the files. Then I made changes proposed by Benjamin (issues and PRs), I hope I did it well...
  22. I already have this logic implemented in my template. I was thinking that your module could just "authenticate" the user with $session->forceUser($user).
×
×
  • Create New...