Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Images

Image Magic

images php coding issues or problems here.

Moderators: macek, egami, gesf

Image Magic

Postby php-vikas » Sat Mar 27, 2004 4:17 am

Can, anybody tell me about Image Magic. :shock:

How can i install it offline. I am working on Window 98 Operating system.

Thanls in advance.

Vikas Garg
php-vikas
New php-forum User
New php-forum User
 
Posts: 164
Joined: Mon Apr 14, 2003 12:25 am
Location: India

Postby swirlee » Sat Mar 27, 2004 10:55 am

User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby Redcircle » Wed Mar 31, 2004 7:47 pm

the windows binaries should work for windows 98. You can download them from http://www.imagemagick.org
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Relation of PHP with ImageMagic

Postby php-vikas » Thu Apr 01, 2004 5:04 am

Hello,

Thanks for your reply.

But still i have some question in my mind.

What is the relation between PHP and imageMagic. How can i use imageMagic with PHP?

Can you suggest me any tutorial on this topic?

I want to use Image Magic with PHP offline on window 98.

Thanks.




[/img][/b]
php-vikas
New php-forum User
New php-forum User
 
Posts: 164
Joined: Mon Apr 14, 2003 12:25 am
Location: India

Postby Redcircle » Thu Apr 01, 2004 8:10 am

The funny thing is there is no relation of imagagick to php at all.

Basically to use imagemagick you use the shell_exec() to issue commands.

To resize an image use
Code: Select all
<?php

$imagemagick_path = "c:\\imagemagick\\";
$new_size = "100"; //imagemagick automatically keeps proportions unless told no to.
$file = "c:\\apache\\htdocs\\uploads\\newfile.jpg"; //full path to file you want to resize

//this example uses mogrify which modifies a file and replaces the file. For an input/ouput function use convert instead
shell_exec($imagemagick_path.'mogrify -resize '.$new_size.'x'.$new_size.' '.$file);


That's all there is too it. Imagemagick has hundreds other functions. Reading the docs is the best method to learn them.
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby swirlee » Thu Apr 01, 2004 8:16 am

Redcircle wrote:The funny thing is there is no relation of imagagick to php at all.


Not so! The first result for the Google link I already posted is a link to the imagick PHP extension at PECL.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby Redcircle » Thu Apr 01, 2004 8:25 am

You talking about the pear extension.. I don't consider pear apart of php just like I don't consider php apart of apache. it's an extension and not built in.
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby swirlee » Thu Apr 01, 2004 8:28 am

Actually it's a PECL extension (PEAR = classes written in PHP, PECL = extensions written in C). At any rate, if it's an option, using the extension is very much preferable to using shell_exec().
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby Redcircle » Thu Apr 01, 2004 8:32 pm

to each his own
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA


Return to PHP coding => Images

Who is online

Users browsing this forum: Google [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.