Image tools

Technical support for webhosting Resellers, and questions which directly relate to their services.

Moderator: Admins

Post Reply
Alexander
not so much a newbie
Posts: 50
Joined: Fri Dec 20, 2002 2:52 pm

Image tools

Post by Alexander »

Hey Miles,

Could you install either NetPBM (http://netpbm.sourceforge.net/) or ImageMagick (http://www.imagemagick.org) on www6? They are/can-be used to f.e. create thumbnails and do auto resizes of images.

It could be possible they are already there, but I can't figure out the path. I know the "GD" (http://www.boutell.com/gd) is online and running, but it's either cripled or an old copy, but the images it creates look horrible. (Maybe a reinstall helps?)

Thanks in advance :)
Alexander
porcupine
Site Admin
Posts: 703
Joined: Wed Jun 12, 2002 5:57 pm
Location: Toronto, Ontario
Contact:

Re: Image tools

Post by porcupine »

Alexander wrote:Hey Miles,

Could you install either NetPBM (http://netpbm.sourceforge.net/) or ImageMagick (http://www.imagemagick.org) on www6? They are/can-be used to f.e. create thumbnails and do auto resizes of images.

It could be possible they are already there, but I can't figure out the path. I know the "GD" (http://www.boutell.com/gd) is online and running, but it's either cripled or an old copy, but the images it creates look horrible. (Maybe a reinstall helps?)

Thanks in advance :)
GD is on www6 and definatly should not be crippled, nor a very old copy.

I just re-installed Image::Magick, I could have sworn it was there before, but when I did a locate, i didn't find it.... So I guess not :)

You'll find it under the default path now :).
Myles Loosley-Millman
Priority Colo Inc.
myles@prioritycolo.com
http://www.prioritycolo.com
porcupine
Site Admin
Posts: 703
Joined: Wed Jun 12, 2002 5:57 pm
Location: Toronto, Ontario
Contact:

Post by porcupine »

rather i should say it will be re-installed soon:

--11:18:02-- http://layer1.cpanel.net/magick.tar.gz
(try: 2) => `magick.tar.gz'
Connecting to layer1.cpanel.net[66.197.217.12]:80... connected.
HTTP request sent, awaiting response...
Read error (Connection reset by peer) in headers.
Retrying.

--11:21:49-- http://layer1.cpanel.net/magick.tar.gz
(try: 3) => `magick.tar.gz'
Connecting to layer1.cpanel.net[66.197.217.12]:80... connected.
HTTP request sent, awaiting response...
Read error (Connection reset by peer) in headers.
Retrying.

--11:25:38-- http://layer1.cpanel.net/magick.tar.gz
(try: 4) => `magick.tar.gz'
Connecting to layer1.cpanel.net[66.197.217.12]:80... connected.
HTTP request sent, awaiting response...
Read error (Connection reset by peer) in headers.
Retrying.

--11:29:27-- http://layer1.cpanel.net/magick.tar.gz
(try: 5) => `magick.tar.gz'
Connecting to layer1.cpanel.net[66.197.217.12]:80... connected.


Looks like the first attempt didn't fly, burstnet must be having connectivity issues.
Myles Loosley-Millman
Priority Colo Inc.
myles@prioritycolo.com
http://www.prioritycolo.com
Alexander
not so much a newbie
Posts: 50
Joined: Fri Dec 20, 2002 2:52 pm

Post by Alexander »

So thats why it didn;t work ;)

Let us know when it's there :)
Alexander
porcupine
Site Admin
Posts: 703
Joined: Wed Jun 12, 2002 5:57 pm
Location: Toronto, Ontario
Contact:

Post by porcupine »

Alexander wrote:So thats why it didn;t work ;)

Let us know when it's there :)
This time it's actually running smoothly, will be done within 5 minutes. :)
Myles Loosley-Millman
Priority Colo Inc.
myles@prioritycolo.com
http://www.prioritycolo.com
Alexander
not so much a newbie
Posts: 50
Joined: Fri Dec 20, 2002 2:52 pm

Post by Alexander »

I feel stupid for asking, but hey .. euhmz. .could you post the path to it when you're done? (usr/bin or usr/local or uisr/local/image ,... I forgot which one to use) ...
Alexander
porcupine
Site Admin
Posts: 703
Joined: Wed Jun 12, 2002 5:57 pm
Location: Toronto, Ontario
Contact:

Post by porcupine »

Alexander wrote:I feel stupid for asking, but hey .. euhmz. .could you post the path to it when you're done? (usr/bin or usr/local or uisr/local/image ,... I forgot which one to use) ...
the 'locate' and 'whereis' commands are handy in a pinch like this:

root@www6 [~]# whereis ImageMagick
ImageMagick: /usr/share/ImageMagick /usr/man/man1/ImageMagick.1

obviously you don't want the man pages, just the program :).
Myles Loosley-Millman
Priority Colo Inc.
myles@prioritycolo.com
http://www.prioritycolo.com
isinglass
newbie
Posts: 4
Joined: Wed Jul 10, 2002 12:58 pm

GD library

Post by isinglass »

I use the GD library for creating thumbnails and have found that using the function ImageCreateTrueColor creates far better images than the function ImageCreate

If your scripts are using ImageCreate you might like to try the ImageCreateTrueColor function instead. I think there may have been a change between versions of the GD library as I used to use ImageCreate and noticed a change in the quality which led me to make the above change.
Alexander
not so much a newbie
Posts: 50
Joined: Fri Dec 20, 2002 2:52 pm

Post by Alexander »

I will check that ou. Script using the GD is 4Images (1.7) . .and while on other hosts it works flawlesly here the tumbnails created look like not-so-good-looking-ones (256 colors even I think) .. .I'll try it and let you know :)

edit, think i found it:

Code: Select all

  if (defined('CONVERT_IS_GD2') && CONVERT_IS_GD2 == 1) {
    $thumb = imagecreatetruecolor($width, $height);
  }
  else {
    $thumb = imagecreate($width, $height);
  }
Thats on line of /includes/image_utils.php
Alexander
isinglass
newbie
Posts: 4
Joined: Wed Jul 10, 2002 12:58 pm

4images

Post by isinglass »

I downloaded 4images to have a look.

What I think you need to do is edit the file constants.php
/includes/constants.php

find the line
define('CONVERT_IS_GD2', 0);

and change this to
define('CONVERT_IS_GD2', 1);
// If you use GD higher 2.0.1 and PHP higher 4.0.6 set this to 1.
// Your thumbnails will be created with better quality

Code: Select all

  if (defined('CONVERT_IS_GD2') && CONVERT_IS_GD2 == 1) { 
    $thumb = imagecreatetruecolor($width, $height); 
  } 
  else { 
    $thumb = imagecreate($width, $height); 
  }
What this code is saying is if CONVERT_IS_GD2 is defined and its set to 1 use the true color create otherwise use the normal create. The variable CONVERT_IS_GD2 is set in the constants file and is 0 by default (imagecreate) which produces poor results.

hope this fixes it :)
Last edited by isinglass on Sun Jul 20, 2003 6:57 pm, edited 1 time in total.
Alexander
not so much a newbie
Posts: 50
Joined: Fri Dec 20, 2002 2:52 pm

Post by Alexander »

Oh I just edited $thumb = imagecreate($width, $height); to $thumb = imagecreatetruecolor($width, $height); ... also does the trick ;)

Thanks for your reply though ! :)
Alexander
Post Reply