Jump to content

horst

PW-Moderators
  • Posts

    4,088
  • Joined

  • Last visited

  • Days Won

    88

Everything posted by horst

  1. Modern PHP Cheat Sheet A to-the-point summary of all awesome PHP features https://front-line-php.com/cheat-sheet
      • 13
      • Like
      • Thanks
  2. Until today, since 20+ years, every time when I inspected such behaves, it comes out at 100% that the source image simply got the wrong notation in the EXIF rotation flag. Mostly directly when created from a camera, but also came from image tools that rotated images without updating the EXIF rotation flag. In my opinion, the new browser behave isn't of any help but makes it more "mysterious" for regular users when working within image processing chains. The ONLY point where this new behave is helpful is when original images will be displayed on the front in a webpage (and have uncorrected rotation).
  3. What I do not understand is why the original code has worked for 15+ years and now (within a sudden) it should not do anymore. As far as I could not find any changes in the EXIF specs. ?? Are you sure that the corrections arrays are wrong, really? Or may it be that the browsers have changed to a behave that rotates images ONLY BY VIEW, and that this new browser behave has to be corrected elsewhere in the inspection and processing workflow? Just wondering.
  4. Hehe. Documentation often lags far behind development. ?
  5. Thats an interesting approach! Thanks. ? And there is this tool that can help a lot by finding alternative fonts for the stack: https://font-match.netlify.app/ @all: Many thanks for the help and thoughts! ?
  6. This is Corbel and not Corbel Light. ANd it is TrueType and not Webfonts (woff woff2). Yes it is part of Win10, but is it legal to use them in a website of a professional freelancer without a license from MS? A license for Corbel (Webfonts and usage with self hosting) can be bought at www.fonts.com, for example.
  7. Hi, a client want to have the MS font Corbel Light for the website. I found the font Corbel at Micr*s*fts fonts.com, but not Corbel Light. Does anybody know where to get this, or a free alternative? But only for self hosting the files!
  8. Processwire site top right, the menu DOCS -> API reference | and there you have to look for pageimage(s) https://processwire.com/api/ref/
  9. It needs the image filename and not a url. The php function getimagesize works for files in the systems filesystem. But why do you not use the $image->width and $image->height properties when you already have the $pageimage object. Why invoking an additional call to an external function when all you want to know is already there?
  10. Yep!!! ? I'm not sure. Maybe I haven't use this function in the last 5 years. I will try to look at it in the next days.
  11. This was a try to automatically detect the colors and hue and create a grayscale watermark text. A full file path to a TTF-fontfile can be passed as param to the function. Here you can read about the function in general:
  12. At first: Please look at the settings for this CKE field(s). There are checkboxes for showing or removing images without view access for guests. Second: check the access rights for (repeater)templates and its containing image fields!
  13. yep, it stores them as regular pageimage variations and you can remove them by hand when opening "variations" in an image inputfield. You also can remove them by calling the core method $image->removeVariations(), but this also removes other variations like the adminThumbnail and maybe variations from CKE-fields and others. Therefore there is the pim2Load('ALIAS')->removePimVariations(), so that you can remove only the pimvariations for that specific alias name. If you are in experimental mode with pim2, you have the option to load it with a second param (called $forceRecreation in the API page) that automatically refreshes this single variation. If you use a specific options array as second param with pim2Load(), you can set $forceRecreation as third param. ? $image->pim2Load('wm', true)-> ...
  14. It is working as expected since the positioning first was implemented. Here is the announcement post: There is also a tip and a photoshop action for download available in the second post of the thread. Do you use lowercase? https://github.com/horst-n/PageImageManipulator/blob/master/ImageManipulator02.class.php#L151-L162 If not please try with lowercase and report back. ------ No there are no API differences, only the opening method is different: $image->pimLoad() becomes $image->pim2Load(). Thats all. I changed the title of the first post for more clarity.
  15. With the module PageimageManipulator you can find a description for "watermarkLogo" that will result in a code like this in your template file: $frame = $pages->get('/settings/')->watermark; foreach($images as $image) { $wmImage = $image->pim2Load('wm', ['quality'=>100, 'sharpening'=>'none', 'defaultGamma'=>-1])->watermarkLogo($frame, $position='NW', $padding=1.5)->pimSave(); // do something with $wmImage } You can find the API explained here (look out for watermarkLogo): And there is a post about simple text here: https://processwire.com/talk/topic/4264-page-image-manipulator-1/?tab=comments#comment-41989 But if you want to use simple text on the images, it would be better not to use my module. Instead try Ukyos avbImage! There is more and better support for simple text watermarks:
  16. NAMESPACE - NAMESPACE - NAMESPACE - NAMESPACE ? <?php namespace ProcessWire;
  17. Looks to me that we always have to provide a template object and not a templates name when not in template file scope. The reason why this is working in template file scope may have to do with some extra work and attention of pw behind the scenes in template file scope. (like outputformatting etc.) But this is only my intuitive idea, no valid technical description. ?
  18. Have you also checked the entries in the root .htaccess file, if they are correct?
  19. Let all your code you need to run twice in the root of _init.php. Wrap all other, like the include_once of the _functions.php into a superglobal var condition, or, if the include of the _functions.php is the only issue you have, you can wrap this in a condition with function_exists: if(!function_exists("aFunctionNameThatExistsInFunctionsPhp")) include(__DIR__ . "/_functions.php");
  20. Ok, maybe scoping is what is in the way. Try setting as $GLOBALS["alreadyExecuted"].
  21. Maybe this does not work (I'm on mobile), but have you tried to set a var in _init.php like this: if(isset($alreadyExecuted) && $alreadyExecuted) return; $alreadyExecuted = true; // set it in the first run. EDIT: Or bind the include of _functions.php on the condition of the var.
  22. Its coming in Safari and iOS-Safari https://caniuse.com/?search=webp%20image versions 14 TP and 14
  23. https://jakearchibald.com/2020/avif-has-landed/
  24. Maybe a bit OT: with which php version is the script processed, and which set of modules are enabled for the php processor? Is it the same version the webserver is running on?
×
×
  • Create New...