horst-n / pageimagemanipulator Goto Github PK
View Code? Open in Web Editor NEWProcessWire :: This module provide basic Imagemanipulations for PageImages or Imagefiles
License: GNU General Public License v2.0
ProcessWire :: This module provide basic Imagemanipulations for PageImages or Imagefiles
License: GNU General Public License v2.0
Module is 2.8 and ImageManipulator is 2.7 and it doesn't work but throw error.
Horst, great addition!
It would be nice to have the defaults (most important: quality) configurable in the module settings (or even better: move it to the images field), so the configuration doesn't get lost when updating the module.
Also it would be awesome if it would be possible to configure a configuration set on a field (or also thumbnail) basis. For example if I have some background images, I would like to set 60% as quality standard, while smaller images perhaps need 80%. If this would be integratable into the thumbnail settings, it be even more awesome. Think of responsive websites, where you want the different thumbnails have different qualities. So a configuration for the thumbnail/cropImage filed could look like:
fullpagesmartphone,480,300,50%,sepia,soft
fullpagetablet,1024,720,60%,none,none
fullpage,2000,1000,75%,grayscale,none
(just an example, I know cropImage config has more options).
Great work!
I made a video of the issue here:
https://www.youtube.com/watch?v=Q-puAOAC17Y
I'm fairly certain this is something I'm doing but I cannot seem to get this module to load a ttf font for watermarking. No matter what variation I try to load the ttf font I get:
Error: Exception: Cannot read the TrueTypeFile needed for watermarkText! (in /home/yyhmsg01/public_html/theory.yinyanghouse.com/site/modules/PageImageManipulator/ImageManipulator.class.php line 1784)
It all works fine with =null or even blank...
this doesn't work even though the font is there...
// $wmfont = $config->urls->templates . 'img/JennaSue.ttf';
nor does a more explicit path
// $wmfont = "/home/xxx/public_html/xxx.com/site/templates/img/JennaSue.ttf";
echo $wmfont;
$imgsrc = $img->pimLoad('tw',true)->width(275)->watermarkText('my watermark', $size=8, $position=SE, $padding=15, $opacity=45, $trueTypeFont=$wmfont)->pimSave();
Any ideas? I'm doing dev on a shared host if that matters....
Could you share some code that you used to load the watermark font in the demos that clearly have this working?
Thanks,
-Chad.
Hi! ๐
I was getting the error "Cannot load the MemoryImage!" using the canvas()
function (which worked great on another site using PHP 7), so did a bit of digging.
In PHP 8, the return value from imagecreatefromstring()
is an instance of the GdImage
class - not a resource, like in previous versions.
This causes an issue inside isResourceGd()
, so it fails to recognise the value is in fact a GD image. This means imLoad()
also returns false.
I modified the method to look like this, so it works:
public static function isResourceGd(&$var) {
if (class_exists('\GdImage') && $var instanceof \GdImage) return true;
return is_resource($var) && strtoupper(substr(get_resource_type($var),0,2))=='GD' ? true : false;
}
Haven't tested it in PHP 7 but can't see why it wouldn't work. Not sure if the syntax is to your liking but here you go :)
Thanks for the great module!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.