Skip Menu |

This queue is for tickets about the Imager CPAN distribution.

Report information
The Basics
Id: 16209
Status: resolved
Priority: 0/
Queue: Imager

People
Owner: TONYC [...] cpan.org
Requestors: jfoste [...] woodward.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.45
Fixed in: (no value)



Subject: Extra gif file when saving gif as jpg
Using Apache 1.3.31 and perl 5.8.0 I upload a gif file and create an Imager object using the upload file handle from Apache::Request. When I save it as type jpeg I get an extra empty file with the same name except it has a gif extension instead of jpg. In the example code I would get two file Thumbnail.jpg and Thumbnail.gif. example code - my $Upload = apr->upload; my $img = Imager->new; $img->read( fh => $Upload->fh) my $newimg = $img->scale(xpixels=>105, ypixels=>73); $newimg->write( type=>"jpeg", file=>"Thumbnail.jpg");
Hi, I tried to reproduce your problem with the attached Apache handler, using the following form to submit the file: <html><body> <form method="post" action="/imagerdoupload" enctype="multipart/form-data"> <input type="file" name="file" /> <input type="submit" /> </form> and the following apache config to run the handler (path to require elided): <Location /imagerdoupload> SetHandler perl-script PerlRequire /.../ImagerFileTest.pm PerlHandler ImagerFileTest </Location> and was not able to reproduce the problem. I tried this with both Imager 0.44 and Imager 0.45.
package ImagerFileTest; use strict; use Imager; use Apache::Request; use Apache::Constants qw(:common); # this is a content handler that tests vs # https://rt.cpan.org/Ticket/Display.html?id=16209 my $work_dir = '/home/httpd/test.develop-help.com/work/'; sub handler { my $r = shift; my $apr = Apache::Request->new($r); # let mod_perl handle the die, which shouldn't happen anyway chdir $work_dir or die "Could not chdir $work_dir: $!"; my $Upload = $apr->upload; my $img = Imager->new; $img->read( fh => $Upload->fh) or die "Could not load image from upload: ", $img->errstr; my $newimg = $img->scale(xpixels=>105, ypixels=>73); $newimg->write( type=>"jpeg", file=>"Thumbnail.jpg"); $r->content_type('text/plain'); $r->send_http_header; $r->print("File upload completed\n"); return OK; } 1;
Marking stalled until I receive a response from the requestor to my reply.
From: jfoste [...] woodward.com
[TONYC - Wed Dec 7 22:04:51 2005]: Show quoted text
> Marking stalled until I receive a response from the requestor to my > reply.
You are correct. It is not a problem. I had remenants from old code that was causing the problems. Thanks for the quick response and I'm sorry to have taken your time up with a non-problem. Jeff F>