Welcome Guest, Not a member yet? Register   Sign In
how to resize image and use watermark in the same time using image manipulation class ?
#1

[eluser]Laith99[/eluser]
Hello guys

i'm using image manipulation class, i'm using 'dynamic_output' and it's necessary for my application. but i have a problem i want to resize an image and watermark it without saving it, i want only to resize and watermark the source image without affecting the source image. and i can't save a temporary image. for example i can't resize the image save it and watermark it again.

Thanks
#2

[eluser]Mat-Moo[/eluser]
I added dynamic output to image_moo for you, but only good if you have php 5 and using gd.
http://ellislab.com/forums/viewthread/161469/
Code:
$this->load->library("image_moo");
$this->image_moo
  ->load("Source.jpg")
  ->load_watermark("watermark.gif")
  ->crop(x1,x2,y1,y2)
  ->watermark(2)
  ->save_dynamic();
if ($this->image_moo->errors) print $this->image_moo->display_errors();
Would/should do the trick Smile of course you could always crop resize, or stretch or any other function I added
#3

[eluser]Laith99[/eluser]
[quote author="Mat-Moo" date="1280027070"]I added dynamic output to image_moo for you, but only good if you have php 5 and using gd.
http://ellislab.com/forums/viewthread/161469/
Code:
$this->load->library("image_moo");
$this->image_moo
  ->load("Source.jpg")
  ->load_watermark("watermark.gif")
  ->crop(x1,x2,y1,y2)
  ->watermark(2)
  ->save_dynamic();
if ($this->image_moo->errors) print $this->image_moo->display_errors();
Would/should do the trick Smile of course you could always crop resize, or stretch or any other function I added[/quote]

Thanks a lot, but can i do something like quality and color the text watermark or set the opacity for overlay ? can we do algin and offset too ?

Thanks a LOT
#4

[eluser]Mat-Moo[/eluser]
Opacity is $this->image_moo->set_watermark_transparency(X) 1..100 100 is solid.
Position is done as a keypad so $this->image_moo->watermark(8) is top middle, 3 is bottom right, same as a keypad. You can also specify a direct location using $this->image_moo->watermark(100,40,TRUE); 100=x 40=4 True = use direct coords. Default indentation is 8 away from the edge, you can change this with the 2nd param, e.g. $this->image_moo->watermark(1,16); bottom left, indent 16 pixels.
Jpeg quality is set with $this->image_moo->set_jpeg_quality(x); default is 75, 100 is best, 0 worst.

Sorry there is no proper help file, I will write it next week, but there is a list of pointers at the start of the lib file itself.
#5

[eluser]Laith99[/eluser]
[quote author="Mat-Moo" date="1280028511"]Opacity is $this->image_moo->set_watermark_transparency(X) 1..100 100 is solid.
Position is done as a keypad so $this->image_moo->watermark(8) is top middle, 3 is bottom right, same as a keypad. You can also specify a direct location using $this->image_moo->watermark(100,40,TRUE); 100=x 40=4 True = use direct coords. Default indentation is 8 away from the edge, you can change this with the 2nd param, e.g. $this->image_moo->watermark(1,16); bottom left, indent 16 pixels.
Jpeg quality is set with $this->image_moo->set_jpeg_quality(x); default is 75, 100 is best, 0 worst.

Sorry there is no proper help file, I will write it next week, but there is a list of pointers at the start of the lib file itself.[/quote]


THANKS A LOT .... YOU ARE THE BEST Tongue




Theme © iAndrew 2016 - Forum software by © MyBB