Zebra_Image, a lightweight image manipulation library written in PHP

Get the latest updates on this PHP library via RSS



You are currently browsing comments. If you would like to return to the full story, you can read the full entry here: “Zebra_Image, a lightweight image manipulation library written in PHP”.

85 responses to “Zebra_Image, a lightweight image manipulation library written in PHP”

Follow the comments via RSS
  • Mr. Jesux, 2014-04-10, 04:41

    Hi, I’m newbie and I would like to know some things. I hope you can assist me.

    How it applied to gray scale effect, since it fits where I get to gray but the effect does not respect the image dimensions, or place the image in full color and sizes respects.

    I would like to know where in the judgment put you apply the color to gray scale?

    $image->source_path = $file;
    $image->target_path = $path_new."/".$image_name."_magazine@X1.".$image_ext;
    $image->apply_filter('grayscale');
    $image->resize(220, 157, ZEBRA_IMAGE_CROP_CENTER);
    Reply
    • Stefan Gabos, 2014-05-19, 19:46

      that is happening because all the library’s methods work on the source file. so, you are first applying the filter to the source file and save it with a different name, and then you are resizing the source file and save it with the same name, overwriting the previous one. the solution is

      $output = $path_new . '/' . $image_name . '_magazine@X1.' . $image_ext;
      
      $image->source_path = $file;
      $image->target_path = $output;
      
      $image->apply_filter('grayscale');
      
      // make sure we're working on the new, grayscale, image
      $image->source_path = $output;
      $image->resize(220, 157, ZEBRA_IMAGE_CROP_CENTER);
  • ahmed samy, 2015-12-02, 03:25

    thanks for this class nice work 🙂

    Reply
  • raf, 2016-04-03, 13:16

    Hi,
    thank for the code

    Is there something to do to preseve transparancy on png? Because conversions of my png having a blank background…

    Thank in adavnce
    raf

    Reply
  • Rafael Fiori, 2016-08-31, 22:19

    Can i insert watermark?

    Reply
  • asimo, 2017-03-06, 07:45

    does the resize function able to retain animated gif?

    Reply

Leave a Reply

Your email address will not be published
You can use <strong>, <em>, <a>, <img>, <code>
Characters are not case-sensitive