-
Posts
4,077 -
Joined
-
Last visited
-
Days Won
87
Everything posted by horst
-
I will look more closely into it later, as I have a bit pressure atm. In the current project there only is one template in use for csv export and I haven't tested further. Only unchecked other templates for that user in the roles access tab.
-
If I'm not totally wrong, Pageimage->size (->width, ->height) checks if the image-variation is available, and / or if there are options present that force a recreation. The creation of variations is done in image rendering engines, that will be started from PageImage->size only if there is no variation available, or if it needs to be recreated, (forced by global or individual options). There must be a flag availabe for pageimages called something like isModified. Maybe this can help? If you need further support on PageImage and getting out informations or tweak its behave to suite your needs, please tell me and I will dig into it. ?
-
@ryan, the site is beautyful in so many details! I directly fallen in love with those little wire-loops and plugs etc. ? ! I will have some more in depth looks next week, as I have to work this weekend. Only one thing I want to show you know: Unfortunately the fonts render very bad on my machine, win7 firefox 64. I'm aware that it do not render that bad on all win7 machines, but I'm also not aware of any special settings regarding fonts rendering on my machine. I setup my system completly new from scratch last year, and I left the most things by default settings where applicable, (to reduce time with the setup, as I have to change in 2019). There are, maybe 15% webfonts in websites that behaves like this one too. (?) A 1:1 PNG screenshot is uploaded here, so that it doesn't get rendered through a forums image engine. Please look at it in 100% scale. https://biriba.de/pw_pop3/new-pw-site---fonts-rendering-ugly-win7-ff64.png
-
Thanks @Robin S, now, after enabling a globally template edit permission for the role, I have the action displayed in the lister and can execute it with this roles users. And now, I can revoke it for all other templates but the one I want it to have, and its working too. <confused>Why isn't it working the other way round: don't add globally edit permission on all templates, but only the one I want it to have?</confused>
-
Hi, I have a setup where a user role has permissions to edit, create, delete, (and add on the parent) as it has permissions to use the lister(s). I installed page-action-export-csv and gave this permission to a template that is also used in a lister. Now, when I view the lister page with that role, I don't have access to this action. ?? In the Access Tab for that role, this permission is not displayed for selection. What is wrong with my setup? Additionally: Simply trying to add this page-action-export-csv-permission to that role via CLI seems not to work, as it is removed automatically on next page load. Or is my code wrong for that? $permission = $permissions->get('page-action-export-csv'); $role = $roles->get('myrole'); $role->addPermission($permission);
-
How to temporarily add permission to access protected page's images?
horst replied to LAPS's topic in General Support
Moderator comment: Please do not open new threads for the exact same topic. It is perfectly fine to post to the already existing thread: https://processwire.com/talk/topic/19420-how-to-allow-guests-to-access-protected-pages-assets-just-for-some-occasions/?tab=comments#comment-168548 This new thread is closed now. -
Convert Pages with image field to php array / json
horst replied to pwFoo's topic in General Support
read more here: http://ocramius.github.io/blog/fast-php-object-to-array-conversion/ -
Convert Pages with image field to php array / json
horst replied to pwFoo's topic in General Support
https://stackoverflow.com/questions/10631767/converting-array-and-objects-in-array-to-pure-array or: https://duckduckgo.com/?q=php+object+to+array+conversion&t=ffab&ia=web ? -
this one from here: https://processwire.com/talk/topic/11355-large-b2b-website-goes-processwire/?tab=comments#comment-105946
-
(taken from https://processwire.com/talk/topic/7494-case-study-the-triumph-of-national-geographic-traveller-india-in-processwire/) More can be seen here: https://www.fixmy.pw/blog/why-we-love-processwire-cms-so-much-especially-after-working-with-crappy-joomla-wordpress-and-drupal-cmss/, starting at "For Developers, it's a welcome dream." ?
-
Hmmm, there is a new action for PageListerPro (https://processwire.com/blog/posts/processwire-3.0.121-core-updates-and-more/).
-
Yes! It's just for testing right now.
-
What exactly is / was the issue? Are the thumbs variation files missing or residing corrupted in the filesystem?
-
Module development in ProcessWire - development environment?
horst replied to Gadgetto's topic in Module/Plugin Development
I'm on win7 and use different PW and different PHP versions in parallel, by switching symlinks. I create individual site folders for each project, regardless if it is a client site or a module. Then I copy shell scripts of the desired PW versions into the webroot folder of the project, and by executing one, it creates me a wire folder, symlinked to the desired PW version. This way, I can switch between different PW versions with one or two clicks. To test with different PHP versions is possible with executing shellscripts of my allday editor NoteTabPro. It shutdown the running apache service, symlinks the apache main directory with one that suports the desired PHP version and starts the service again. -
With a hook in site/ready.php like this one, // hook for pageimages to return a webp url $wire->addHookProperty('Pageimage::urlWebp', function($event) { $image = $event->object; $path_parts = pathinfo($image->filename); $webpFilename = $path_parts['dirname'] . '/' . $path_parts['filename'] . '.webp'; if(!is_readable($webpFilename)) { $event->return = '#'; // what should be returned for none existing webp variations ? return; } $path_parts = pathinfo($image->url); $webpUrl = $path_parts['dirname'] . '/' . $path_parts['filename'] . '.webp'; $event->return = $webpUrl; }); you can use it for testing purposes right now.
-
That's the part that is bound to the Pageimage class. Maybe it could be takled by a little extra layer / function, that maps a new configuration API to the old cryptic one, as I do with PIA and her selector strings?
-
Current state is that only the images are created and removed. There is no markup generation or additional url output implemented yet. But will be added soon.
-
I believe that this would need a huge rewriting of the complete images files (Pageimage and the SizerEngines). My first thought also was to enhance it to use different outputformats, as you can read above, (or maybe only in the github issues). But with this first take, I definetly want to use only webp and only as a sidecar file. Other things, like selectable and multiple outputformats are not in the first line. Thats because I have not that much time atm to start a huge rewrite, but want to have the compression advantage of webp integrated directly in PW, as this will be the first possibility included in the core, without usage of external tools and also without extra manipulation steps. And for that purpose, it seems to me enough to implement just another single param. It will be definetly not "easily", as the imagesizer was and is designed to only resize and crop a single image. It is not an image manipulator. And the todo work not will be the ImageSizerEngines but the Pageimage.php, the tempfiles generation and how all this currently works together.
-
Want to announce that I started with embedding support for the WebP format into the core. Current state in my dev-branch is, that you can call / create additional image variations in the WebP format by passing this param within an options array to any size call: // mandatory is: 'webpAdd' => true // optionally define a quality for WebP: 'webpQuality' => 80 // currrently it only is implemented in the GD-Engine, so you need to force its use, $options = [ 'forceEngine' => 'ImageSizerEngineGD', 'forceNew' => true, 'webpAdd' => true, 'webpQuality' => 80 ]; $image = $page->images->first->size(700, 700, $options); If you want to be an early tester, you can get a fork from here (patch-1), or you grap these three files: Pageimage.php ImageSizerEngine.php ImageSizerEngineGD.php More will be done between christmas and new year!
-
Yes. And, if you are not able to do a fresh install, you may install and use the Diagnostic-Modules from @netcarver to do a check on unknown server environments. ?
-
ping: @ryan This one would be really useful: https://github.com/processwire/processwire/pull/117 Also this is not an issue, it would be really helpful to have this enhanced debugInfo integrated into the current dev branch, before it becomes the new stable. It doesn't affect any other method or param, - only enhances the __debugInfo() method with useful informations. This would be really helpful for debug and support cases, if someone encounters a problem and ask here in the forums for help, we can get a good insight / overview in his/her current images system by simply asking to show us that info.
-
Make page stick to the bottom of the page tree
horst replied to Michael van Laar's topic in General Support
+1 ping: @tpr ?? ? -
How to setup Composer and use external libraries in ProcessWire
horst replied to MoritzLost's topic in Tutorials
@MoritzLost regarding earliest include of the autoloader, I think the site config.php is the right place. It is parsed / executed before modules, but it get not overwritten with core updates. ? -
Hi @blynx, many thanks for this great module! ?
- 41 replies
-
- photoswipe
- module
-
(and 1 more)
Tagged with:
-
Hi Sam, there is PageimageManipulator available for PW: With it you can do something like: $imageBase = // get the base image here $imageOverlay = // get the thumbnail overlay image here // first wrap a 50px transparent (rgba) canvas around the overlay image and convert it to png format: $imageOverlay = $imageOverlay->pim2Load("prefix")->canvas($imageOverlay->width + 100, $imageOverlay->height + 100, array(0,0,0,0), "center")->setOutputFormat("png")->save(); // now stretch the overlay image canvas to match the base image dimensions: $imageOverlay = $imageOverlay->pim2Load("prefix")->canvas($imageBase->width, $imageBase->height, array(0,0,0,0), "northwest")->save(); // now merge both images together $imageResult = $imageBase->pim2Load("prefix")->watermarkLogo($imageOverlay, "center", 0)->save(); // The resulting pageimage can also be adjusted using regular pw image functions, if necessary $imageResultThumb = $imageResult->width(150); Better is to chain the manipulations of the overlay image into one call: $imageBase = // get the base image here $imageOverlay = // get the thumbnail overlay image here // two steps to create the canvas with the thumb at the desired position and convert the output to png format: $imageOverlay = $imageOverlay->pim2Load("prefix")->setOutputFormat("png")->canvas($imageOverlay->width + 100, $imageOverlay->height + 100, array(0,0,0,0), "center")->canvas($imageBase->width, $imageBase->height, array(0,0,0,0), "northwest")->save(); // now merge both images together $imageResult = $imageBase->pim2Load("prefix")->watermarkLogo($imageOverlay, "center", 0)->save(); Please refer to the PageimageManipulator page for the documentation of all methods and params, but ask here, if something is not clear. ?