-
Posts
4,077 -
Joined
-
Last visited
-
Days Won
87
Everything posted by horst
-
@psy You can set webpQuality to lower values what will result in smaller filesizes. Examples:
-
How to Use External Library in PW Module? (SOLVED)
horst replied to EyeDentify's topic in Getting Started
@teppo === "Mr Eagle Eye" ? -
How to Use External Library in PW Module? (SOLVED)
horst replied to EyeDentify's topic in Getting Started
The only thing what may occure in very rare cases is, that another module in the same PW installation also uses the TwitterOAuth lib, stored in a different place. To avoid conflicts, one can add a conditional check before including it, using the PHP function class_exists(). <?PHP namespace ProcessWire; if(!class_exists("Abraham\TwitterOAuth\TwitterOAuth") { /* load the TwitterOAuth library from my Module folder */ require_once("./twitteroauth/autoload.php"); } use Abraham\TwitterOAuth\TwitterOAuth; Also one may prefer require_once() over require(), if there is a chance that the class / class file is loaded twice. -
Hi all users of the croppable image 3 fieldtype. I'm currently working on the module, or better I'm reworking the module to support webp copys like the core image field does. Unfortunately this will break backwards compatibility! ? My questions are, how should we handle this? Until now the crop variation has this sort of names: basename.ext becomes basename.-suffix.ext But with the new version, it looks like regular image variation files with a -suffix: basename.ext becomes basename.100x200-suffix.ext My current thoughts are along that lines: I create a new named module: CroppableImage4, that supports the same API as the CAI3 version plus an alternative method like getCrop4("suffix"), and I add some checking, when the CAI3 is installed / active, it only hooks the plus method, not the regular one. What do you think? Any suggestions, ideas, wishes? And how can we savely update from CAI3 to CAI4, for example with existing websites containing tons of images ❓ PS: Besides that, the new module now supports individual $options as array or selector strings. It generates 0x48 thumbs and webp copies by auto generation and by manually creating a crop. It removes all variations on every changes: changing a single image, changing or removing settings. It has input fields in modules config for webpAdd and webpQuality, so you can handle it different from the $config->imageSizerSettings, and you now can add individual options with every API call, like with the core image field: $pageimage->getCrop("suffix", $options)->url, or $pageimage->getCrop("suffix", $options)->webp->url. And some more minor tweaks.
-
Hohoho, a 3000 x 3000 PNG, for what do you need this? You generate a 1000 x 1000 variation? If you use photoshop jpeg quality 12 you also has lossless master images. My favor would be to have LZW-Tiffs as master, = Lossless compression and a format that cannot wrongly used for web output. ?
-
Yep, and I / we don't like version hunting for all the format issues in Imagick or GD. ?
-
Besides the broken Imagesupport for PNG8 I want to say: "Uploading ImageOptim optimized images are ONLY for output use as is(!), NOT for serving as master image from what one should generate new variations. ? " Everytime when I read something like this, my photographer heart hurts and somewhere a kitten dies, I believe. ?? ?
-
Ah, @ryan has added support for PNG8 to the Imagick engine, what wasn't before. He also asked me why this wasn't added and I was unsure if I simply forgot to add it. But now when I see this, I think I had tested it and removed it from the Imagick supported filetypes / subtypes, so that this images always were rendered by GD! until before the last Update. https://github.com/processwire/processwire/pull/141#issuecomment-495983196 So it seems it should be rolled back again, at least for PNG8. EDIT: I couldn't remember as it is (how many?) years ago as the Image Engine System was introduced. And yep, it would have been better to add some comments. ;-)
-
You should try harder!
-
The image rendering engines have gotten a method / check if and which supports webp creation. I think you best drop an issue at pw github, so that ryan gets knowledge about it. If I find time I try to check this too.
-
Here is a first try with webp support: github webp-dev !! ATTENTION: DO NOT USE ON PRODUCTION SITES !! Maybe the cleaning up for unused variations is broken now. Haven't tested! Also the naming scheme of CAI3->getCrop("suffix") has changed from basename.-suffix.ext to basename.{width}x{height}-suffix.ext Would be fine if some of you have time to test and report back in regard of: removing no longer used variations, changing values of already defined crop settings, (and if previously used variations get deleted, etc) ... Currently there has to be defined true in site/config.php for $config->imageSizerOptions("webpAdd", true); Then you can use it like with core images: $image = $page->images->first->getCrop("suffix"); echo "<img src='{$image->url}' /> <img src='{$image->webp->url}' />";
-
When I try it, I get something like: Notice: Undefined index: _width in \wire\core\Pageimage.php on line 1936 Notice: Undefined index: _height in \wire\core\Pageimage.php on line 1937 These are the new additions from Ryan that I'm currently have not checked how it works, but definetly, if width and height isn't known, the engines cannot create a new variation. I get this for image objects derived from CAI3 and with the original image too! Possibly a bug in the new pageimage additions, or a different use case that currently is not covered.
-
A while ago I bookmarked this: https://css-tricks.com/flutter-googles-take-on-cross-platform/
- 35 replies
-
- 3
-
@ryan thank you very much for all the additions you implemented in such a short time on top of my github pullrequest. It seems that there currently nothing is left in regard of webp support in ProcessWire. But I already have one or two points for future updates to the image rendering engines, that should be implemented when all browsers will support webp and we don't need fallback jpegs or pngs anymore. ?
- 17 replies
-
- 12
-
1054 Unknown column field_fieldname.filedata in field list
horst replied to Klenkes's topic in General Support
I have had this too, today: -
@Lutz Heckelmann Oh, thanks a lot! Now I know what is missing. The column filedata is available in my local version, but is missing in the live version. Only difference between the upgrades from local and live is, that the local one was updated step by step since the last two years, as it is symlinked to my pw-dev-latest directory, but the live one was updated from 3.0.62 to 3.0.130 in one go. So, now I will alter the table to add this missing column. EDIT: Issue solved! ?
-
Ok, I found out that there are 4 pages should contain an image. The images are SVGs and they reside in the respective folders. (As we haven't changed anything in that regard). On the editor pages, the images field is shown empty, even when it should contain one SVG image. Now I think it can be something related to imagefiles especially and only SVG. ?
-
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_section_cooperation_partner_logo_desktop.filedata' in 'field list' After upgrading a live site from 3.0.62 to 3.0.130 we get this error when in PageEditor with that field. It is an image field. We also have done some field and template export and import from a local site to the live site, but nothing in regard to that field or the two templates that contain it. On the pages that raise the error the field is empty. What is this {field_imagename}.filedata used for?? The DB-Dump shows the table is there and correct.
-
We already have this in the image sizer loops: https://github.com/processwire/processwire/blob/bbd3aba191876b2e8aec913357b8b687e1f441a1/wire/core/ImageSizerEngine.php#L1064-L1090 Its called here, with every image starting: https://github.com/processwire/processwire/blob/bbd3aba191876b2e8aec913357b8b687e1f441a1/wire/core/ImageSizerEngine.php#L386 @Mikie : Seems that your php setup do not allow changes to max execution time! You can do a quick test with something like: $old = (int)ini_get('max_execution_time'); set_time_limit(2 * $old + 5); $new = (int)ini_get('max_execution_time'); var_dump(['old' => $old, 'new' => $new, 'supported' => (2 * $old + 5 == $new)]); For troubleshooting you may double check that you edited the right(!) php.ini file, you may check if you have 'set_time_limit' in the disallowed functions, or if you are running in safe-mode, (look into your phpinfo() output)
-
How to programmatically change page name after saving it?
horst replied to VeiJari's topic in API & Templates
@VeiJari maybe hook after pages::saveReady is better for this. But also it is possible in a pages::saved hook to save the page again without running into an infinite loop with, for example, using a temporary property: wire()->addHookBefore("Pages::saved(template=tapahtuma|artikkeli)", function($hook) { $page = $hook->arguments(0); if($page->skipMyHook) { // if the page already has our temporary property, we skip further processing return; } $newUrl = wire()->sanitizer->pageName($page->title); // give it a name used in the url for the page wire()->log->message($page->name); $page->skipMyHook = true; // add a temporary property to the page (it is only in memory) $page->setAndSave('name', $newUrl); }); -
AdminDevModeColors: different colors for development backends
horst replied to BitPoet's topic in Module/Plugin Development
@BitPoet Many thanks for this nice helper! Whats about a little enhancement like this? protected function getStyle() { $bgcolor = $this->bgColor; if($this->config->devModeBgColor) $bgcolor = $this->config->devModeBgColor; if(! $bgcolor) $bgcolor = 'rgb(153, 12, 94)'; $fgcolor = $this->fgColor; if($this->config->devModeFgColor) $fgcolor = $this->config->devModeFgColor; if(! $fgcolor) $fgcolor = 'rgb(255, 255, 255)'; $devstring = $this->devString; if($this->config->devModeDevString) $devstring = $this->config->devModeDevString; if(! $devstring) $devstring = 'DEV'; ... -
Where exactly is the download link for the beta? Haven't seen it in this thread. ?
-
Maybe the earlier members will remember this one from 2014: What results in very nice reactions like Today the newer IP-Board has something like this already included. The only thing, that I would change today, is to add the given reactions of the top posters to the overview screen. Until today I have not known that this gets displayed when you click onto ones reactions sum.