Page 1 of 1

Error 80041771 when resizing

Posted: 2014-08-08T08:54:55-07:00
by edmozley
Hi

I am trying to resize an image in ASP classic and although it does re-size the file it comes up with an error.

My code is as follows

Code: Select all

Set img = Server.CreateObject("ImageMagickObject.MagickImage.1")
  sourceFile="d:\intranets\mybwb\tenders\staffphotos\" & FileName
  destFile="d:\intranets\mybwb\tenders\temp\ResizedPhoto.jpg"
  img.Convert SourceFile, "-resize", "640x480", DestFile
Set img = Nothing
The error I receive is:

<font face="Arial" size=2><p>ImageMagickObject.MagickImage.1</font> <font face="Arial" size=2>error '80041771'</font><p><font face="Arial" size=2>An external object raised an error. No Error Description Available.</font><p><font face="Arial" size=2>/tenders/resizeforemail.asp</font><font face="Arial" size=2>, line 27</font>

I have installed ImageMagick-6.8.9-Q8 64 bit on a Windows 2008 R2 (64 bit) server.

My temporary workaround is to add...

Code: Select all

On Error Resume Next
... at the top but I don't like using this as if there are other problems in the code it will plough on regardless.

Has anyone come across this sort of thing?

Thanks very much

Ed

Re: Error 80041771 when resizing

Posted: 2014-08-10T08:33:07-07:00
by Werty
Others have reported same error when using VB, and it's not only when resizing.

No solution as of yet, other than what you have done yourself, by adding an error handler.

Read this thread...
viewtopic.php?f=1&t=25900

Re: Error 80041771 when resizing

Posted: 2014-11-03T21:02:24-07:00
by icanfind

Code: Select all

Set img = Server.CreateObject("ImageMagickObject.MagickImage.1")

  sourceFile="d:\intranets\mybwb\tenders\staffphotos\" & FileName
  destFile="d:\intranets\mybwb\tenders\temp\ResizedPhoto.jpg"

  ' img.Convert SourceFile, "-resize", "640x480", DestFile
  img.Convert "", SourceFile, "-resize=640x480>",  DestFile

Set img = Nothing

If you want to use "Identify"

Code: Select all

msgs = img.identify("-format=%w, %h, %d, %e, %f, %g, %i,%k, %l, %m, %n, %o, %q, %r, %t, %u, %x, %y, %Z","",SourceFile)
response.write msgs
If you want to use "Identify" Width

Code: Select all

w = img.identify("-format=%w","",SourceFile)
response.write w 
If you want to use "Identify" Height

Code: Select all

h = img.identify("-format=%h","",SourceFile)
response.write h
if you want "Crop, format Convert, Repage(Eleminate none Required Area), resize, rotate" image

Code: Select all

  Set img = Server.CreateObject("ImageMagickObject.MagickImage.1")

   origImg = server.mappath("/imageMagick/")&"/"&"org.jpg"  

  imImg_crop_w = 300
  imImg_crop_h = 400
  imImg_crop_x = 300
  imImg_crop_y = 100 

  ' Crop,  resize, jpg->gif. repage 
  img .Convert "",  origImg, "-crop="& imImg_crop_w &"x"& imImg_crop_h &"+"& imImg_crop_x &"+"& imImg_crop_y,   "-resize=250x250>",  "+repage",  server.mappath("/imageMagick/")&"/"&"r_"& imImg_crop_w &"_"& imImg_crop_h &"_"& imImg_crop_x &"_"& imImg_crop_y &"crop and resize and repage.gif"

  ' Crop,  resize, jpg->gif.repage, rotate
  img .Convert "",  origImg, "-crop="& imImg_crop_w &"x"& imImg_crop_h &"+"& imImg_crop_x &"+"& imImg_crop_y,   "-resize=250x250>",  "+repage", "-rotate=90", server.mappath("/imageMagick/")&"/"&"r_"& imImg_crop_w &"_"& imImg_crop_h &"_"& imImg_crop_x &"_"& imImg_crop_y &"crop and resize and repage rotate.gif"

-------------------------------------------------------------------