ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Image Moo - Image manipulation library

July 20, 2010 11:10am

Subscribe [38]
  • #16 / Sep 25, 2010 7:59am

    Mat-Moo

    350 posts

    http://www.matmoo.com/codeigniter/image_moo/ if you check the comments that has already been pointed out 😊 and fixed (Just not uploaded yet). What’s the point of the background image? I’m not sure what you are trying to achieve. Thanks for the positive comments though.

  • #17 / Sep 25, 2010 8:08am

    hugle

    289 posts

    http://www.matmoo.com/codeigniter/image_moo/ if you check the comments that has already been pointed out 😊 and fixed (Just not uploaded yet). What’s the point of the background image? I’m not sure what you are trying to achieve. Thanks for the positive comments though.

    Yeah, I spotted this comment later 😊 sorry bout that..

    Well, sometimes, when we have a box of 200x200 pixels, and picture only 200x100..
    As for now, we can fill it with the background color, and that’s ok.
    but sometimes it would be good to put background instead of a color.

    Other solution could be:
    to convert an image to PNG, and instead of a color background it would place transparent background. and we just make a <div>./image.png</div>

    Where <DIV> would have an image as a background

    What do you think about it? maybe there are even more elegant solutions?

    Thank you!

  • #18 / Sep 25, 2010 9:35am

    Mat-Moo

    350 posts

    A background div would make more sense, otherwise if there is a change to the site design all your images created would be wrong 😊

  • #19 / Sep 25, 2010 12:00pm

    hugle

    289 posts

    A background div would make more sense, otherwise if there is a change to the site design all your images created would be wrong 😊

    Good tip 😊
    Well, I think I will later search if I can make at least background transparent 😊 so the <DIV> thingy would work

    Thank you:)

  • #20 / Sep 26, 2010 12:10am

    Vega

    21 posts

    Cool lib! Thanks very much for sharing 😊

  • #21 / Sep 28, 2010 6:20pm

    hugle

    289 posts

    Hello again 😊

    on your page, in the manual it is written:

    save_pe($prepend="", $append="", $overwrite=FALSE)

    but it should be : “save_pa(...”

    One little mistake 😊

    as for now, no problems at all 😊

    Thanks one more time 😊

  • #22 / Oct 01, 2010 9:12am

    Mat-Moo

    350 posts

    Updated to 0.9.9 and added shadow facility, updated files on website.

  • #23 / Oct 04, 2010 10:59am

    Antoniofu

    10 posts

    I get this error :

    Message: Undefined property: Image_moo::$error

    the library is copied in “system/libraries/”
    what’s wrong?

  • #24 / Oct 04, 2010 11:05am

    Mat-Moo

    350 posts

    Should be system/application/libraries for ci 1.7.2 and /application/libraries for ci 2.

  • #25 / Oct 04, 2010 11:16am

    Antoniofu

    10 posts

    thanks for the quick reply.

    I’ve tried putting in the application/library folder also

    I’m using codeigniter 1.7.2

    Sorry I’m a newbie with codeigniter and programming.
    I just load the library in the controller and then, in the view put this code :
    $this->image_moo
      ->load(‘DSC01707.JPG’)
      ->resize_crop(100,100)
      ->round(5)
      ->save_dynamic();
    it’s correct?

  • #26 / Oct 04, 2010 11:18am

    Antoniofu

    10 posts

    I know that the my image path should be different, is only an example.

    i have 8 images and I would to create thumbnail for each one. The name of the images come from a database. I have the array with the name of each image and I would like to create this mini-gallery.

  • #27 / Oct 04, 2010 11:26am

    Mat-Moo

    350 posts

    For 1.7.2 you need it in system/application/libraries 😊 Save_dynamic will stream output to the screen not save it anywhere. But otherwise your code is identical to my example. add

    if($this->image_moo->errors) print $this->image_moo->display_errors();.

    after the call (Make sure you using php5) as it will tell you any errors it encounters.

    As for the gallery, assuming you have done the query (active records)

    foreach($dbquery->result() as $row)
    {
     $this->image_moo->load($row->image_name)->resize_crop(100,100)->round(5)->save_dynamic();
    }

    However it would be better to create thumbnails when the image is uploaded and save to disk, instead of always resizing the image.

  • #28 / Oct 05, 2010 10:08am

    Antoniofu

    10 posts

    Thanks, now the library works.

    The problem is that doesn’t show the thumb and the error is :
    could not locate file_name No main image loaded!

    the path is correct, is like :

    src="<?php echo base_url(); ?>images/data/<?php
                    $this->image_moo->load($row->foto)->resize_crop(100,100)->round(5);
                    if($this->image_moo->errors) print $this->image_moo->display_errors(); "
                ?>

    The folder as all the permissions and I’m on my locahost server.

    I will try directly online.

    Thanks a lots for helping and share this library.

  • #29 / Oct 05, 2010 10:14am

    Mat-Moo

    350 posts

    Your calling a function that generates the image, there is no path needed, just use

    src="<?php $this->image_moo->load(base_url()."images/data/".$row->foto)->resize_crop(100,100)->round(5)->save_dynamic()?>"

    You can’t really add the error checking in to the img src, I *think* that will work, not the best way to do it. Better off creating a helper function, but even then you should consider not resizing at run time as the amount of additional cpu power required is a lot more.

  • #30 / Dec 10, 2010 3:26pm

    HomersBrain

    18 posts

    I need help with my watermarks. I’ve tried watermarking a png but all I get is a black image the size of the png. I was wanting to watermark the png because it is overlayed a jpg with a fade effect, and moves out of the way when the pointer is over the top.

    So, I gave up and tried to do the jpg instead. Here’s my code ($image2 is passed in and is ok with the correct path):

    $this->image_moo
                    ->load($image2)
                    ->make_watermark_text("copyright","/applications/xampp/xamppfiles/htdocs/project/x.ttf",25,"#000")
                    ->watermark(1)
                    ->save_dynamic();

    and here’s my error

    A PHP Error was encountered
    Severity: Notice
    Message: Undefined property: Image_moo::$watermark_method
    Filename: libraries/image_moo.php
    Line Number: 829

    Can you help?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases