Giter Site home page Giter Site logo

pageimagemanipulator's People

Contributors

horst-n avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pageimagemanipulator's Issues

Make defaults configurable

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!

Cannot seem to load ttf file...

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.

PHP 8.x: Cannot load the MemoryImage!

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.