Jump to content

matjazp

Members
  • Posts

    721
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by matjazp

  1. @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
  2. Please try this version, check the box under advanced options. AutoSmush.zip
  3. 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?
  4. 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.
  5. 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?
  6. 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...
  7. 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"
  8. 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?
  9. It's working here on Windows and IIS 8.5
  10. 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...
  11. I already have this logic implemented in my template. I was thinking that your module could just "authenticate" the user with $session->forceUser($user).
  12. Strange indeed. <div id="pageID"...></div> is your page404 markup? File upload is working? Try js debuging whwn upload fails. Enough space on disk?
  13. Hi Robin! Thanks for the module. I don't need it actually, but I was thinking if it's possible to see the page rendered as a logged in user, eg. not a guest, without bothering the user to log in? I had that need years ago when I had to show my editors how the page would look like when he is logged in (he see a full list of "Items") vs guest users. And if I go further, I had a need to let the user edit this page (only specific page not all pages with this template) so he can see what he would have to deal with when the site is ready for production. Of course, I could point him to skyscrapers demo site or I could put my site to demo mode, but then I couldn't develop it... This is just an idea i wanted to share with, not a feature request.
  14. @tthom_pw thanks for the report, I'm aware of this. The problem is that there is no svgo binary for windows. So I had to take svgop library, but there are problems too: it's 35 MB binary that takes different parameters. I had to convert/pack svgop to svgo using a batch file and the result is a UPX binary that is always treated as suspicious by antivirus software. I'll most likely remove support for svg on windows in the next release.
  15. Yet another tiny library (under 200 lines) that might come handy: https://github.com/vladocar/nanoJS
  16. @tthom_pwThis report is most likely coming from ConfigServer eXploit Scanner (cxs). You can ask your hosting provider if he is willing to exclude this file from scanning. I'm not familiar with how scanner work but most likely it's searching for strings exec, shell, shell_exec etc.
  17. Leave it. Let the user fix it. While I was able to make it work in a terminal, conversion is unreliable.
  18. In my case, it doesn't help. I was playing with this when I was developing ProcessFileEdit but haven't found a proper solution. Then support for UTF8 for windows was added I think in 7.0 or 7.1 and then I stopped bothering.
  19. The fix would work, but you would have to call it before using wireCache obviously. Don't know if this would impact performance if it would run on a large array.
  20. Yep, that's it. That error contains non UTF-8 characters, I assume they are in Windows-1250 character set. The best option is to configure MySQL to return errors in English. Your my.ini will most likely be found in %programdata%\MySQL folder, in [mysqld] section add lc_messages=en_US. Restart mysqld service for changes to take effect. I guess this commit is the culprit for the PW error (SQL error is, of course, another thing).
  21. It looks familiar with the issue I had with the terminal panel. Would you mind var_dump($data) in WireCache.php at line 442, just before json_encode($data). Examine the $data to ensure it doesn't contain non UTF-8 characters.
  22. Nice! Is terminal supported on windows? Don't have time to play right now, I just tried dir ?
  23. Yep. Ok, I got it.
  24. What do you think about putting temp files at the top?
  25. Oh, that changes everything ?
×
×
  • Create New...