Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by horst

  1. Wouldn't it be better using g**gle search for that? searching forum: site:processwire.com/talk api (https://www.google.com/search?q=site%3Aprocesswire.com%2Ftalk+api) searching whole site: site:processwire.com/ api (https://www.google.com/search?q=site%3Aprocesswire.com%2F+api)
  2. One last try: You may try to (re)save an original image in Photoshop as 24bit PNG with transparency, just to make sure it definetly get handled by the imagick engine. (There is a small chance that, for example, 8bit PMGs with transparency (or different types of transparency) get not handled by imagick, also if you selected it as first engine. PW does an image inspection and if the current prefered engine is marked not to be able to handle that format combination correct, it will be passed to the next engine in the chain. 24bit PNG with transparency definetly will be handled by imagick. (The last one in the chain always is GD, as fallback).
  3. Yep. I bet that this are 99.9% transparent pixels from the originals cutout pictures. I mean the originals were photographed on a more or less white background, then it get cropped not by a hard pixel path but by some tool that uses cropping by transparency mask. After that, a shadow drop was added. In the original images the cropped out area is visually not seen, but there are some pixels with a special setting: color white & transparency 100%. It would have been better, if the cutout had be done by hard cropping, 1-2px into the object. If this currently is resized by GD-lib (PWs default or fallback engine), you may try to switch to ImageMagick engine if the server allows this.
  4. ..., yep, ooor, you should not use ../ this in your dest path. 🙂 This is for security reasons. If you give real $dest pathes without up-traversal segments into your createDuplicateImage() function, then you don't need realpath() there. Or you use it one step earlier: public static function createDuplicateImage($src, $dest) { if (file_exists($src) === false) { return false; } // NOTE new line $dest = realpath($dest); // Duplicate the file \ProcessWire\wire('files')->copy($src, $dest); return new \ProcessWire\ImageSizer($dest); } But anyway. I'm glad you figured it out and finally it is working for you! 😉
  5. This must have to do with the access rights set in your server setup. Normally they get set via wirechmod($filename) automatically. ?
  6. You can do with using the imagesizer directly: $is = new ImageSizer("path/to/your/image/filename.jpg", [OPTIONS-ARRAY--OPTIONAL]); // $is->setOptions([OPTIONS-ARRAY--OPTIONAL]); // or set it later here, or ommit setting individual options and use the defaults ! $is->resize($width, $height); // width or height can be 0 ! This resizes and overwrites the image you pass to it. So if you do this with a PW pageimage, you would overwrite the original image if you pass it the originals name!!
  7. @ryan Thanks for clarification. I somehow mixed it up with the core page paths module in my mind:
  8. Hi @ryan, many thanks for the additions, especially the status one will be used by me! 🙂 I want to ask if the support for matching children paths also works with multi language names, e.g. (/path/to/page/) resolves the same as the de path of the same page (/de/pfad/zur/seite/) ?
  9. On page /en/meineseite/?param=value first save the param into a session var, then do the redirect and in the target page read out the session var $value = $input->get('param'); $value = $sanitizer->text($value); // or any other appropriate sanitizer method for your usecase, and or any other custom validation $session->set('param', "$value"); $session->redirect($YOUR_TARGET_URL); $value = $session->get('param');
  10. Nothing of your posted content looks like a PW installation. Are you sure you are in the right place here?
  11. A short description of what you have done or want to do and what is not functional would be more helpful I believe. Also was there any error given instead of your expected action? I'm on mobile currently and my accu said low memory. So if I'm going offline because of this, I hope someone else can scheme in and help, when we are able to understand your issue. 🙂
  12. @mervin Please post your errors or logs here in text. Do not drop (suspicious) ZIP files here without any description and references to your problem. Otherwise your posts may be judged as spam. 🙂
  13. @markus_blue_tomato One solution could be to store an extra key containing the last modified timestamp from the image together with the blurhash string, and then every time before output, compare the (current) images last modified timestamp with the stored one. If the stored one is older, regenerate the blurhash string.
  14. If you do not have limitations for outgoing (SMTP) E-Mails per/Day or per/Month and if whether your company nor any other user on the same shared hosting is blacklisted in spam protection services, it should be pretty fine to send them on your own.
  15. I posted you a link 2 month ago: I think it can be done with language alternate fields. Have you checked it?
  16. To be honest, I don't know if this is a standard processwire file. But with language files one can use it as follows: Instead of adding each string to an own variable, you can add a second parameter to all the language strings you use around in different template files or module files or where ever you need them: __('Text 1', '/path/to/your/_strings.php'); __('Text 2', '/path/to/your/_strings.php'); ... And instead of adding the '/path/to/your/_strings.php' as text all the time, I use a functions call for that. This way you do not have to include the file and can use it everywhere handled through the PW translations system, because you tell it that the current string is the same as a string in the centralized _strings.php In /site/init.php I define this function, that simply returns the path to my centralized translation file: /** * TRANSLATABLE STRINGS * Include translatable strings */ if(!function_exists('ProcessWire\mystrings')) { function mystrings() { return '/site/_strings.php'; // absolute URL or absolute filepath to the central translation file } } My _strings.php would look like this: <?php namespace ProcessWire; /** * TRANSLATABLE STRINGS * Define globally available translatable strings * * USAGE * * __('Lesen Sie mehr ...', mystrings()); * * The function mystrings() returns the textdomain of this file. * **/ ... __('Datenschutzerklärung'); __('Die Maße des Werks sind:'); __('Dieses Bild drucken!'); __('drucken'); ... __('Text 1'); __('Text 2'); ... __('Zurück zur Übersicht'); To sum up, this way I don't need to include a _strings.php and it also works every where.
  17. What does it contain, whats in the _strings.php? What does it provide? (functions, vars, ...?) Maybe another method than include_once() could be more straight forward and also works with wire-render-pattern.
  18. This is an 360 x 600 px image and its file size is above 10 Megabyte ! Besides the question for what should this be useful, I would check the available memory usage on your online host. Only for creating the admin thumb when uploading that image it may need multiple 100 MB memory, depending on the number of slides in that image.
  19. 1) Are you able to test the site (or a copy of it) with the current dev version 3.0.183/4 (what seems to become the next stable version next week) and check if the latest RepeaterMatrix version is on start too? 2) Also I want to see the exact code how you create the (primary png/jpeg) variations and where the webp() call is executed. Means the whole code for a picture / srcset elements markup please. No 1) would be just to be save that there are not already fixes in with the later version(s), and no 2) seems to be the only (for me known) point where the quirks may come from.
  20. Normally they get removed together with the other variants, so there must be some sort of anomaly or quirks in your site happened. But without any informations where and how you create(d) the webp variations and where and how you remove(d) the variations, any help seems impossible.
  21. When using urlencode, check if the + signs are changed too! Otherwise use a str_replace("+", "%20", $URL) additionally!!
  22. Try: $p>-nativeField->set('fifth-row', new \JNJsonValue('datetime', ti
  23. 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.
  24. 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?
  • Create New...