On Mar 13, 2009, at 7:57 AM, Kevin Walzer wrote:

I'm putting together some code that will write an icon file (obtained via NSWorkspace) to a gif.

I had prototyped the code with a simple command-line tool with hard- coded values for file sources, destinations, and image sizes. However, when I try to abstract the code, I am now getting weird error messages:

<Error>: CGImageCreate: invalid image size: 0 x 0.
2009-03-13 10:40:48.805 Wish[20760:10b] Could not create CGImageRef - w:0, h:0, bps:8, bpp:32, bpr:512, alpha:0x1, cSpace:NSCalibratedRGBColorSpace, hasAlpha:1, isPlanar:0

Log your width and height values to see what they really are. You appear to be using 0, 0. Incidentally, setPixelsWide: and setPixelsHigh: do not do what you appear to think they do. You could also check [icon isValid] to make sure the image is available.

objc[20760]: FREED(id): message release sent to freed object=0x466430

This is because you are incorrectly managing memory for icon and resizeicon. Check the docs on that again.


--
Adam

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to