Re: simple app

From: Date: Mon, 10 Jun 2002 15:24:40 +0000
Subject: Re: simple app
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-2115@lists.php.net to get a copy of this message
FYI PECL has an imagemagik extension... havent used it though should work on win32 as well... if you can compile it... http://pear.php.net/manual/en/pecl.imagick.php At 12:24 10/06/2002 +0800, firepages.com.au wrote:
Hi, I use Image magick for converting the images to pixmaps.... www.imagemagick.org ) /*example .... $path_to convert is one of the image magick executables*/ $path_to_convert='c:/gtkdev/WVS/scripts/resource/convert.exe'; /* the directory to check for images and convert to pixmaps*/ $im_dir="e:/phpdev4/bin/magick/WVS"; function convert_directory($path_to_convert,$im_dir){ $exts=array('jpg','gif','bmp');/*add your favourite exensions here - magick does pretty much anything useful*/ $d = dir($im_dir); while($entry=$d->read()) { if(strtolower(substr($entry,-3,3))=='xpm'){
     $xpm[]=$entry;
    }elseif(in_array(strtolower(substr($entry,-3,3)),$exts)){
     $other[]=$entry;
    }
} $d->close(); /* all non xpm to xpm*/ while(list($key,$var)=each($other)) { $xvar=str_replace(substr($var,-3,3),'xpm',$var); if(!in_array($xvar,$xpm))
    {
    /*you can alter the size of the generated pixmaps here*/
     exec("$path_to_convert -geometry 200x200 $im_dir/$var $im_dir/$xvar");
    }
} } /*calling convert_directory($path_to_convert,$im_dir); turns all non XPM's to XPM's */ to diplay them I cheat and turn the images into buttons as thats the only way I can get the images to be clickable!... and the built in FTP functions of PHP are fine - no need to be opening your own sockets etc note that the imagemagick convert.exe plays havoc with the \%WINDIR%\convert.exe which is why I am using the absolute path and not just adding image magick to my PATH I think the above is all you need for the images bit -?? ----- Original Message ----- From: <steph.fox@btinternet.com> To: <ed.holland@ntlworld.com>; <php-gtk-general@lists.php.net> Sent: Sunday, June 09, 2002 10:03 PM Subject: Re: [PHP-GTK] simple app I think Simon already made something like this, check with him (firepages.org)
 from:    Ed Holland <ed.holland@ntlworld.com>
 date:    Sun, 09 Jun 2002 12:24:03
 to:      php-gtk-general@lists.php.net
subject: Re: [PHP-GTK] simple app Hey, this is not as simple as it seems, although still possible. Firstly you would have to convert the images to pixmaps before viewing,
and then you would have to create a socket to a server, using the ftp protocol upload these files, ..etc..etc.
If you do find I'm wrong pls shout me down and make the app :P
-- PHP-GTK General Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP-GTK General Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.gtk.general (#2115) next »