Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image::Resize

Status
Not open for further replies.

youradds

Programmer
Jun 27, 2001
817
GB
Hi,

I'm just trying to use Image::Resize ( , but I'm getting some weird errors :/

The code I'm using (only for testing), is:

Code:
use strict;
use GD;

    use Image::Resize;
#print "Content-Type: text/html \n\n";

my $file = q|./P0001360.jpg|;


    my $image = Image::Resize->new($file);
    my $gd = $image->resize(250, 250);

    open (DISPLAY,"| display -") || die;
      binmode DISPLAY;
      print DISPLAY $gd;
    close DISPLAY;

..and the output is:

ultranerds@east dev $ perl test.cgi
Version: ImageMagick 6.2.6 01/26/06 Q16 Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC

Usage: display [options ...] file [ [options ...] file ...]

Where options include:
-antialias remove pixel-aliasing
-authenticate value decrypt image with this password
-backdrop display image centered on a backdrop
-border geometry surround image with a border of color
-channel type apply option to select image channels
-clip clip along the first path from the 8BIM profile
-clip-path id clip along a named path from the 8BIM profile
-coalesce merge a sequence of images
-colormap type Shared or Private
-colors value preferred number of colors in the image
-colorspace type alternate image colorspace
-comment string annotate image with comment
-compress type type of pixel compression when writing the image
-contrast enhance or reduce the image contrast
-crop geometry preferred size and location of the cropped image
-debug events display copious debugging information
-define format:eek:ption
define one or more image format options
-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 display image to this X server
-dispose method GIF disposal method
-dither apply Floyd/Steinberg error diffusion to image
-edge factor apply a filter to detect edges in the image
-endian type endianness (MSB or LSB) of the image
-enhance apply a digital filter to enhance a noisy image
-extract geometry extract area from image
-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
-format "string" output formatted image characteristics
-frame geometry surround image with an ornamental border
-gamma value level of gamma correction
-geometry geometry preferred size and location of the Image window
-help print program options
-identify identify the format and characteristics of the image
-immutable displayed image cannot be modified
-interlace type type of image interlacing scheme
-label name assign a label to an image
-limit type value pixel cache resource limit
-log format format of debugging information
-loop iterations loop images then exit
-map type display image using this Standard Colormap
-matte store matte channel if the image has one
-monitor monitor progress
-monochrome transform image to black and white
-negate replace every pixel with its complementary color
-page geometry size and location of an image canvas
-profile filename add, delete, or apply an image profile
-quality value JPEG/MIFF/PNG compression level
-quiet suppress all error or warning messages
-raise value lighten/darken image edges to create a 3-D effect
-remote command execute a command in an remote display process
-repage geometry size and location of an image canvas (operator)
-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
-scenes range image scene range
-segment value segment an image
-set attribute value set an image attribute
-sharpen geometry sharpen the image
-size geometry width and height of image
-strip strip image of all profiles and comments
-support factor resize support: > 1.0 is blurry, < 1.0 is sharp
-texture filename name of texture to tile onto the image background
-treedepth value color tree depth
-trim trim image edges
-update seconds detect when image file is modified and redisplay
-verbose print detailed information about the image
-version print version information
-visual type display image using this visual type
-virtual-pixel method
virtual pixel access method
-window id display image to background of this window
-window_group id exit program when this window id is destroyed
-write filename write image to a file

In addition to those listed above, you can specify these standard X
resources as command line options: -background, -bordercolor,
-borderwidth, -font, -foreground, -iconGeometry, -iconic, -mattecolor,
-name, -shared-memory, -usePixmap, or -title.

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.

Buttons:
1 press to map or unmap the Command widget
2 press and drag to magnify a region of an image
3 press to load an image from a visual image directory
ultranerds@east dev $

I'm a bit confused as to why:

1) This error is saying about ImageMagick , instead of GD?
2) Why this error is coming up, when surely it should be showing me a shrunk image?

TIA

Andy
 
The message you're getting has nothing whatsoever to do with your Perl script.

The problem is the `display` program that you're executing towards the end of your script. You apparently didn't pass it any arguments that it knows how to deal with, so it gives you its standard "this is how to use the display program" response. Double-check your command syntax there.

`display` probably uses Image::Magick.

-------------
Cuvou.com | My personal homepage
Project Fearless | My web blog
 
Hi,

Thanks - I think its a Perl / server issue on my machine :(

The exact same code, works fine on servers - so I guess it just needs the modules and maybe the GD librarys updated :)

Thanks for the reply though - as least someone did <G>

Cheers

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top