Drupal + imagecache + Invalid image dimensions error?

Imagecache was dutifully scaling images without any problems, when suddenly this error started popping up:

warning: imagecreatetruecolor() [function.imagecreatetruecolor]: 
Invalid image dimensions [...]

It started when I added an extra action to one of my imachecache presets: after scaling to a fixed width, I wanted to crop to a fixed height while keeping the previously attained width.

To scale to a fixed width, you need to enter the target width and keep the height blank. Quite straightforward. No problem.

However, to crop, you need to enter both target width and target height, even when one of them is to remain unchanged.

So, lesson boys and girls: always enter width and height when defining a crop action in imagecache.

Comments

Sounds like a usability error

Sounds like a usability error to me: on crop the imagecache UI should require both width and height.

Yes, that's my conclusion as

Yes, that's my conclusion as well. If not filling in a field results in a php error then the field should be mandatory.

Thx
J.

that is kinda crazy... glad

that is kinda crazy... glad you had this page up, because i'm getting this error... and there were certainly no clues as to why.

did you already make a ticket for this? i see a few already.. so not sure if there's any point in making another.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options