473,396 Members | 2,059 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

php and images

Hi all,

I'm writing a module for a Content Management System called 'Site@School'
(siteatschool.sf.net). One of it's requirements is that if any other
software package is used, it must be invisible to the user.

Now I need to resize jpeg and gif images. When I use php extensions like
imagick.so or the gd-lib one, I cannot include them into the module. The
user that installs the module (which can be a school on their ISP's
webspace) must also install the extensions and adapt the sytem's php.ini
file (which is impossible if you don't have root access).

I know recent php versions can be compiled with the --enable-gd option,
but I'm not allowed to make that assumption (maybe an ISP doesn't want it
to enable because of possible security problems for example).

Do you know any solution to this problem? (it should be possible, although
not trivial, to compile and install a package in ones homedirectory)

much thanks in advance,

Martin
Jul 17 '05 #1
3 2442
"Martin Herrman" <m.*******@student.tue.nl> wrote in message
news:pa****************************@student.tue.nl ...
Hi all,

I'm writing a module for a Content Management System called 'Site@School'
(siteatschool.sf.net). One of it's requirements is that if any other
software package is used, it must be invisible to the user.

Now I need to resize jpeg and gif images. When I use php extensions like
imagick.so or the gd-lib one, I cannot include them into the module. The
user that installs the module (which can be a school on their ISP's
webspace) must also install the extensions and adapt the sytem's php.ini
file (which is impossible if you don't have root access).

I know recent php versions can be compiled with the --enable-gd option,
but I'm not allowed to make that assumption (maybe an ISP doesn't want it
to enable because of possible security problems for example).

Do you know any solution to this problem? (it should be possible, although
not trivial, to compile and install a package in ones homedirectory)

much thanks in advance,

Martin


Run imagemagick from the command line instead of using an extension.
Jul 17 '05 #2
On Thu, 09 Oct 2003 18:04:16 +0000, Jason wrote:
Run imagemagick from the command line instead of using an extension.


it's so simple :-)

Thanks!

Martin
Jul 17 '05 #3
Jason wrote:
"Martin Herrman" <m.*******@student.tue.nl> wrote in message
news:pa****************************@student.tue.nl ...
Hi all,

I'm writing a module for a Content Management System called 'Site@School'
(siteatschool.sf.net). One of it's requirements is that if any other
software package is used, it must be invisible to the user.

Now I need to resize jpeg and gif images. When I use php extensions like
imagick.so or the gd-lib one, I cannot include them into the module. The
user that installs the module (which can be a school on their ISP's
webspace) must also install the extensions and adapt the sytem's php.ini
file (which is impossible if you don't have root access).

I know recent php versions can be compiled with the --enable-gd option,
but I'm not allowed to make that assumption (maybe an ISP doesn't want it
to enable because of possible security problems for example).

Do you know any solution to this problem? (it should be possible, although
not trivial, to compile and install a package in ones homedirectory)

much thanks in advance,

Martin


Run imagemagick from the command line instead of using an extension.


Actually, the way I do it is to first see if GD is compiled in. Since I
only use jpeg or png images, I check for functions that relate to those
image types.

if($image_type=='jpeg' && !function_exists('imagecreatefromjpeg'){
// GD is not installed with jpeg support, use image magick
}else if($image_type=='jpeg'){
// use GD to resize the image
}else if($image_type=='png' && !function_exists('imagecreatefrompng'){
// GD is not installed with pngsupport, use image magick
}else if($image_type=='png'){
// use GD to resize the image
}

This way, if GD is installed, you can simply use it. On the other hand,
if you need to use imagemagick (from the command line), you need to know
where on the server it is installed. Sometimes this is as trivial as
doing a $im_convert=system('which convert'); However, if IM isn't in the
path, then you'd have to specify where it is on the system.

HTH

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Wayne | last post by:
I have a script that uses filesystemobject that reads files from a given path, in my case images. It is running on a server that is 2000 adv svr w/ all current patches. The script prior to some...
3
by: Simon | last post by:
This problem has been driving me mad for months.... Seen a few posts on forums about it but no answers... No mention on MSDN etc. XP Pro SP1, VS.NET (c#) .Net framework 1.1, IIS 5.1. In a...
10
by: Neo Geshel | last post by:
I am seeking to hand-roll my own blog in ASP.NET 2.0 and SQLExpress 2005. Why? Because I can. Because I will gain experience. The one thing that has me stumped at square one is inline images....
6
by: wattanabi | last post by:
Greetings, I'm attempting to layout a bunch of images in a grid using DIV's instead of a table. I currently have a 3x6 table that I need to convert to css. I've seen various example of a 3 to 4...
2
by: mouseit101 | last post by:
Hi, I'm writing a script that would (hopefully) search google images for whatever, and then return a list of URLs for the image. Right now I have: $dom = new DomDocument(); $url =...
0
by: Frenchie | last post by:
Hi, I have created a very neet menu from an example found on the MSDN library at: http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.menuitembinding.imageurlfield.aspx My...
1
by: Cerebral Believer | last post by:
Hi folks, I am using the following code for mouse over (roll-overs) in my XHTML code. <a onmouseover="document.getElementById('sitemap').src = '../images/buttons/sitemap_mo.jpg';"...
4
toxicpaint
by: toxicpaint | last post by:
Hi, can anyone give me a hand. I'm currently displaying 4 random images at the top of a page. I did this using an array of 35 pictures and then writing them to page. The problem I have is that in...
5
by: remon87 | last post by:
I need some help. I have javasript that creates the submenu but it works if I have a text with css. I need it to do the same with a roll over images. so when I click on the image the submenu...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.