in reply to Re^5: Image magic creation of thumb fail
in thread Image magic creation of thumb fail

Yes I see it now, I updated the PATH within C:\Strawb~1\c\bin;%PATH% and PERL_HOME to point to C:\Strawberry\perl\bin but I still have conflict between two version of perl. Awesome I run my program within the correct bin path and it's worked again thank you. EDIT The script run well within command line but I got an exception while I'm been running it as a CGI script
#!C:/Strawberry/perl/bin/perl.exe -w use warnings; use Image::Thumbnail; use CGI; use CGI::Cookie; use Time::HiRes qw(gettimeofday); use CGI::Lite (); my $query = CGI->new ; $imgdir= "C:/Users/41786/OneDrive/Documents/recordz1/upload"; #my $t = new Image::Thumbnail( # module => 'Imager', # size => 55, # create => 1, # input => "$imgdir/282.jpg", # outputpath => "$imgdir/test.jpg", #); # With Image Magick my $file = $query->param("image"); print "Content-Type: text/html\n\n"; my $t = new Image::Thumbnail( size => "55x75", create => 1, module => "Image::Magick", input => "$imgdir/282.jpg", outputpath => "$imgdir/test2.jpg"); print "test";
Leave me and exception within Magick.xs.dll is not loaded.

Replies are listed 'Best First'.
Re^7: Image magic creation of thumb fail
by *alexandre* (Scribe) on Jan 08, 2023 at 02:29 UTC
    Now everyhings works well here is simple full cript
    #!C:/Strawberry/perl/bin/perl.exe -w use warnings; use Image::Thumbnail; use CGI; use Image::Magick; my $query = CGI->new ; $imgdir= "C:/Users/41786/OneDrive/Documents/recordz1/upload"; # With Image Magick my $file = $query->param("image"); uploadImage("1.jpg"); sub uploadImage { my $name = shift || ''; my $file = $query->param('image'); open(LOCAL, ">$imgdir/$name") or print 'error'; my $file_handle = $query->upload('image'); + binmode LOCAL; while(<$file_handle>) { print LOCAL; } close($file_handle); close(LOCAL); $t = new Image::Thumbnail( size => "55x75", create => 1, module => "Image::Magick", input => "$imgdir/$file", outputpath => "$imgdir/thumb.$name.jpg"); }