Page 2 of 3

Re: JPEG Image Quality - how good is it?

Posted: 2010-11-22T11:50:49-07:00
by Bonzo
You can do it through WHM although I chickened out when my hosts offered to do it for me ( managed VPS ).

Its under software - Install a RPM - Imagemagick although I am not sure which version you need.

I have installed through Putty which is not to hard and I can find the notes I made if you want. I did not install ghostscript then but its installed on Linux servers anyway ?

Re: JPEG Image Quality - how good is it?

Posted: 2010-11-22T11:59:29-07:00
by Bonzo
This is what I used on some nonmanaged servers - worked OK on the Verio servers but not the Media Temple servers. Its nearly a year ago since I did it so can not remember the full details.

Code: Select all

Logon to the server using Putty

su

Password again for root access

# uninstall old ImageMagick
yum remove ImageMagick

# get new ImageMagick sources
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
#or
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.6.0-0.tar.gz

# untar
tar -zxvf ImageMagick*.tar.gz
cd ImageMagick*

# Extra steps recommended by snibgo – I think I managed to install OK before without but was starting to get a shared libraries: libMagickCore.so.3 error

export LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"
export LD_LIBRARY_PATH="/usr/local/lib"

ldd /usr/local/bin/convert
ABOVE LINE ONLY DIDN’T WORK ON V1 – DID WORK ON V2

# configure and make
./configure
make

# install
make install

Go to server control panel and restart httpd ? You can try from putty but again I was getting an error.

Re: JPEG Image Quality - how good is it?

Posted: 2010-11-22T14:34:23-07:00
by Fubster
Wonderful! Thanks for that - I will be trying this evening, I think (still have had no reply from my host).

Re: JPEG Image Quality - how good is it?

Posted: 2010-11-23T08:08:53-07:00
by Fubster
OK, my host beat me to it, but something must be hosed somewhere, old version of JPEG writer or something. I ran this command on the original Photoshop.jpg image from above:

Code: Select all

convert Photoshop.jpg -quality 100 Photoshop_out.jpg
The result looks like this:
Image
This is the email he sent after doing the install:
Installed:
ImageMagick.i386 0:6.2.8.0-4.el5_5.3

Dependency Installed:
GConf2.i386 0:2.14.0-9.el5 ORBit2.i386 0:2.14.3-5.el5
audiofile.i386 1:0.2.6-5 avahi.i386 0:0.6.16-9.el5_5
avahi-glib.i386 0:0.6.16-9.el5_5 cryptsetup-luks.i386 0:1.0.3-5.el5
dbus-glib.i386 0:0.73-10.el5_5 dbus-python.i386 0:0.70-9.el5_4
dmidecode.i386 1:2.10-3.el5 esound.i386 1:0.2.36-3
ghostscript.i386 0:8.15.2-9.12.el5_5 ghostscript-fonts.noarch 0:5.50-13.1.1
gnome-keyring.i386 0:0.6.0-1.fc6 gnome-mime-data.i386 0:2.4.2-3.1
gnome-mount.i386 0:0.5-3.el5 gnome-vfs2.i386 0:2.16.2-6.el5_5.1
hal.i386 0:0.5.8.1-59.el5 hwdata.noarch 0:0.213.18-1.el5.1
kbd.i386 0:1.12-21.el5 lcms.i386 0:1.18-0.1.beta1.el5_3.2
libIDL.i386 0:0.8.7-1.fc6 libXres.i386 0:1.0.1-3.1
libbonobo.i386 0:2.16.0-1.1.el5_5.1 libbonoboui.i386 0:2.16.0-1.fc6
libcroco.i386 0:0.6.1-2.1 libdaemon.i386 0:0.10-5.el5
libglade2.i386 0:2.6.0-2 libgnome.i386 0:2.16.0-6.el5
libgnomecanvas.i386 0:2.14.0-4.1 libgnomeui.i386 0:2.16.0-5.el5
libgsf.i386 0:1.14.1-6.1 libnotify.i386 0:0.4.2-6.el5
librsvg2.i386 0:2.16.1-1.el5 libutempter.i386 0:1.1.4-4.el5
libvolume_id.i386 0:095-14.21.el5_5.1 libwmf.i386 0:0.2.8.4-10.2
libwnck.i386 0:2.16.0-4.fc6 libxslt.i386 0:1.1.17-2.el5_2.2
notification-daemon.i386 0:0.3.5-9.el5 pciutils.i386 0:2.2.3-8.el5_4
pm-utils.i386 0:0.99.3-10.el5.centos shared-mime-info.i386 0:0.19-5.el5
startup-notification.i386 0:0.8-4.1
I could not help but notice that his list of dependencies (same as delegates?) did not list any jpg library, as I saw in the link provided to delegates: jpegsrc.v8b.tar.gz. Is that the problem? The jpg writer is still out of date? Any ideas on how I correct that? Or if that's not the problem, how do I correct the situation?

Thanks again for all the help :)

Re: JPEG Image Quality - how good is it?

Posted: 2010-11-23T08:31:56-07:00
by Bonzo
Thats what I thought would happen as I think 6.2.8 is a php 5 default. Its still a very old version as Fred said.

This will give you a lot more information

Code: Select all

<?php 
// Build the array of items to be used 
exec("convert convert -list list", $IMarray, $code); 
// Start the loop to find and display the results 
foreach ($IMarray as $value) { 
echo "<br>system (\"convert -list $value\")"; 
echo "<pre>"; 
system("convert -list $value"); 
echo "</pre><hr>"; 
} 
?> 

Re: JPEG Image Quality - how good is it?

Posted: 2010-11-23T08:42:01-07:00
by Fubster
:?
Warning: exec() has been disabled for security reasons in .... on line 3
I probably have access to change that, unless it requires a php re-compile which I've never done....

AGGGHHH!!

Re: JPEG Image Quality - how good is it?

Posted: 2010-11-23T08:59:11-07:00
by Fubster
We are running on PHP Version 5.2.9. safe_mode - Off. I'm googling and looking at other settings that may cause exec to get this security setting.

Re: JPEG Image Quality - how good is it?

Posted: 2010-11-23T09:01:22-07:00
by Fubster
HOLY COW - I think I found it: (running phpinfo)
disable_functions = system,passthru,exec,popen,proc_close,proc_ge t_status,proc_nice,proc_open,proc_terminate,shell_exec ,highlight_file,escapeshellcmd,define_syslog_variables,posix_uname,posix_getpwuid,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,escapeshellarg,posix_uname,ftp_exec,ftp_connect,ftp_login,ftp_get,ftp_put,ftp_nb_fput,ftp_raw,ftp_rawlist,ini_alter,ini_restore,inject_code,syslog,openlog,define_syslog_variables,apache_setenv,mysql_pconnect,eval,phpAds_XmlRpc,phpAds_remoteInfo,phpAds_xmlrpcEncode,phpAds_xmlrpcDecode,xmlrpc_entity_decode,fp,fput

Re: JPEG Image Quality - how good is it?

Posted: 2010-11-23T09:57:12-07:00
by Bonzo
Yes you need to edit the php.ini file and I would remove system and exec from the disabled functions.

Re: JPEG Image Quality - how good is it?

Posted: 2010-11-23T11:15:07-07:00
by Fubster
OK, I got the exec and system out of my php.ini file. Run that script and it gave me back nothing. I added an echo to before and after the loop just to be sure, and those echoes displayed but nothing in the loop, so the loop is never executing, IMarray is empty.

Re: JPEG Image Quality - how good is it?

Posted: 2010-11-23T11:24:24-07:00
by Bonzo
Have you tried a simple php script as I pressume your last test was with a command ( do not forget to CHMOD the directory to 777 )?

Code: Select all

$array=array(); 
echo "<pre>";
exec("convert input.jpg output.jpg 2>&1", $array);  
echo "<br>".print_r($array)."<br>";  
echo "</pre>"; 
You may need to use the full path to convert which can be found with:

Code: Select all

<?php 
echo "<pre>"; 
system("type convert");  
echo "</pre>"; 
?> 
replace convert with whatever the code above displays; something like user/local/bin/convert

Re: JPEG Image Quality - how good is it?

Posted: 2010-11-23T11:28:09-07:00
by Fubster
Actually, I went to putty and ran the command there:

Code: Select all

# convert -list list
convert: Invalid list type (list).
Then I tried it without the second parameter. Now I can laugh at my host who said he installed 6.2.8. This days he installed 5.5.1, right?

Code: Select all

# convert -list
Version: ImageMagick 5.5.1 10/20/02 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 2002 ImageMagick Studio LLC

Usage: convert [options ...] file [ [options ...] file ...] [options ...] file

Where options include:
  -adjoin              join images into a single multi-image file
  -affine matrix       affine transform matrix
  -antialias           remove pixel-aliasing
  -append              append an image sequence
  -authenticate value  decrypt image with this password
  -average             average an image sequence
  -background color    background color
  -blue-primary point  chomaticity blue primary point
  -blur geometry       blur the image
  -border geometry     surround image with a border of color
  -bordercolor color   border color
  -channel type        extract a particular color channel from image
  -charcoal radius     simulate a charcoal drawing
  -chop geometry       remove pixels from the image interior
  -clip                apply clipping path if the image has one
  -coalesce            merge a sequence of images
  -colorize value      colorize the image with the fill color
  -colors value        preferred number of colors in the image
  -colorspace type     alternate image colorspace
  -comment string      annotate image with comment
  -compress type       image compression tyhpe
  -contrast            enhance or reduce the image contrast
  -crop geometry       preferred size and location of the cropped image
  -cycle amount        cycle the image colormap
  -debug events        display copious debugging information
  -deconstruct         break down an image sequence into constituent parts
  -delay value         display the next image after pausing
  -density geometry    horizontal and vertical density of the image
  -depth value         image depth
  -despeckle           reduce the speckles within an image
  -display server      get image or font from this X server
  -dispose method      Undefined, None, Background, Previous
  -dither              apply Floyd/Steinberg error diffusion to image
  -draw string         annotate the image with a graphic primitive
  -edge radius         apply a filter to detect edges in the image
  -emboss radius       emboss an image
  -encoding type       text encoding type
  -endian type         LSB or MSB
  -enhance             apply a digital filter to enhance a noisy image
  -equalize            perform histogram equalization to an image
  -fill color          color to use when filling a graphic primitive
  -filter type         use this filter when resizing an image
  -flatten             flatten a sequence of images
  -flip                flip image in the vertical direction
  -flop                flop image in the horizontal direction
  -font name           render text with this font
  -frame geometry      surround image with an ornamental border
  -fuzz distance       colors within this distance are considered equal
  -gamma value         level of gamma correction
  -gaussian geometry   gaussian blur an image
  -geometry geometry   perferred size or location of the image
  -green-primary point chomaticity green primary point
  -gravity type        horizontal and vertical text placement
  -help                print program options
  -implode amount      implode image pixels about the center
  -intent type         Absolute, Perceptual, Relative, or Saturation
  -interlace type      None, Line, Plane, or Partition
  -label name          assign a label to an image
  -level value         adjust the level of image contrast
  -limit type value    Disk, Map, or Memory resource limit
  -list type           Color, Delegate, Format, Magic, Module, or Type
  -loop iterations     add Netscape loop extension to your GIF animation
  -map filename        transform image colors to match this set of colors
  -mask filename       set the image clip mask
  -matte               store matte channel if the image has one
  -median radius       apply a median filter to the image
  -modulate value      vary the brightness, saturation, and hue
  -monochrome          transform image to black and white
  -morph value         morph an image sequence
  -mosaic              create a mosaic from an image sequence
  -negate              replace every pixel with its complementary color
  -noop                do not apply options to image
  -noise radius        add or reduce noise in an image
  -normalize           transform image to span the full range of colors
  -opaque color        change this color to the fill color
  -page geometry       size and location of an image canvas
  -paint radius        simulate an oil painting
  -ping                efficiently determine image attributes
  -pointsize value     font point size
  -preview type        image preview type
  -profile filename    add ICM or IPTC information profile to image
  -quality value       JPEG/MIFF/PNG compression level
  -raise value         lighten/darken image edges to create a 3-D effect
  -region geometry     apply options to a portion of the image
  -raise value         lighten/darken image edges to create a 3-D effect
  -red-primary point   chomaticity red primary point
  -render              render vector graphics
  -resize geometry     resize the image
  -roll geometry       roll an image vertically or horizontally
  -rotate degrees      apply Paeth rotation to the image
  -sample geometry     scale image with pixel sampling
  -sampling-factor geometry
                       horizontal and vertical sampling factor
  -scale geometry      scale the image
  -scene value         image scene number
  -seed value          pseudo-random number generator seed value
  -segment values      segment an image
  -shade degrees       shade the image using a distant light source
  -sharpen geometry    sharpen the image
  -shave geometry      shave pixels from the image edges
  -shear geometry      slide one edge of the image along the X or Y axis
  -size geometry       width and height of image
  -solarize threshold  negate all pixels above the threshold level
  -spread amount       displace image pixels by a random amount
  -stroke color        graphic primitive stroke color
  -strokewidth value   graphic primitive stroke width
  -swirl degrees       swirl image pixels about the center
  -texture filename    name of texture to tile onto the image background
  -threshold value     threshold the image
  -tile filename       tile image when filling a graphic primitive
  -transform           affine transform image
  -transparent color   make this color transparent within the image
  -treedepth value     color tree depth
  -trim                trim image edges
  -type type           image type
  -undercolor color    annotation bounding box color
  -units type          PixelsPerInch, PixelsPerCentimeter, or Undefined
  -unsharp geometry    sharpen the image
  -verbose             print detailed information about the image
  -version             print version information
  -view                FlashPix viewing transforms
  -virtual-pixel method
                       Constant, Edge, Mirror, or Tile
  -wave geometry       alter an image along a sine wave
  -white-point point   chomaticity white point
  -write filename      write images to this file

By default, the image format of `file' is determined by its magic
number.  To specify a particular image format, precede the filename
with an image format name and a colon (i.e. ps:image) or specify the
image type as the filename suffix (i.e. image.ps).  Specify 'file' as
'-' for standard input or output.

Re: JPEG Image Quality - how good is it?

Posted: 2010-11-23T11:32:27-07:00
by Bonzo
You probably have two versions !

If you can find where the newer version is installed you may be able to use that with my example above where it finds the path. That may explain why your test was not very good quality as it was using the 5.5.1 version :?

Re: JPEG Image Quality - how good is it?

Posted: 2010-11-23T12:14:49-07:00
by Fubster
Thanks - I've sent an email to my host asking for a clarification, where 6.2.8 is loaded and why I am accessing 5.5.1.

Re: JPEG Image Quality - how good is it?

Posted: 2010-11-23T12:56:39-07:00
by fmw42
Are you using Godaddy? If so,

6.2.8 is at /usr/local/bin

5.x is at /usr/bin