image nstextattachment without .extension -> inf. loop
image nstextattachment without .extension -> inf. loop
- Subject: image nstextattachment without .extension -> inf. loop
- From: Seth Delackner <email@hidden>
- Date: Thu, 26 Jun 2003 21:48:30 +0000
- Mail-followup-to: email@hidden, email@hidden
1. Create an attributed string with an image NSTextAttachment
2. beginEditing a text storage
3. insert the image into the text storage
4. endEditing
Single stepping into NSTextStorage endEditing and it begins
to infinitely repeat the log statements:
Assertion failure in NSCreateFilenamePboardType(), AppKit.subproj/NSPasteboard.m:368
nil string passed to NSCreateFilenamePboardType
This happens if the attached image is a photoshop image with
no extension. If I add any extension that would be handled
by NSBitmapImageRep (.bmp, .tiff, .jpg for example), then
endEditing doesn't die. I checked and even with no
extension, the image is successfully loaded, since a bitmap
rep is created.
A similar problem occurs if I create an image and give the
attachment filewrapper a filename that conflicts with the
true type of the image, say .bmp for a pictClipping: "Can't
read BMP file". Which wouldn't be so bad, except that it
never returns, just spewing that log error over and over.
A workaround would be to only insert images if they have a
"correct" extension, but how am I supposed to know the
correct extension?! I would have to force-convert every
loaded image to a known type, since NSImage cannot divulge
the .3 extension it needs.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.