Skip to main content
Known Participant
February 10, 2011
Question

Image resized to 1 pixel?

  • February 10, 2011
  • 1 reply
  • 280 views

I've got a script in VB which basically opens an image and resizes it...

Dim appRef
appRef = CreateObject("Photoshop.Application")

appRef.Preferences.RulerUnits = 1

Dim image

Dim filename = " "C:\image.jpg"

image = appRef.Open(fileName)

image.ResizeImage(600, , 72)
image.ResizeCanvas(, 300)

Now 99% of the time this works fine, but every now and then I find that the image has been resized to only 1 pixel and the last event in the history is "select canvas"

I remember coming across this problem before and I figured out what the problem was, but I can't remember exactly what it was. I'm pretty sure it's something to do with the resolution. I thought I'd resolved it though.

Only problem is I can't seem to replicate the problem even if I use the same image and the majority of the time it will work fine!

Any ideas?

Thanks.

This topic has been closed for replies.

1 reply

Muppet_Mark-QAl63s
Inspiring
February 10, 2011

I know nothing of VB so do forgive me… But 'appRef.Preferences.RulerUnits = 1' I would not expect this to want an integer value? May not even be the cause of your issue but some VB wording of measurement unit PIXELS