• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSBitmapImageRep from tiff NSData bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBitmapImageRep from tiff NSData bug?


  • Subject: Re: NSBitmapImageRep from tiff NSData bug?
  • From: Heinrich Giesen <email@hidden>
  • Date: Tue, 6 Feb 2007 21:03:51 +0100

hello,

On 06.02.2007, at 19:53, Patrick Haruksteiner wrote:


you are right, bmpRep seems correct. I implemented your fix, but it does not work for me, I'm getting "CGImageDestinationFinalize failed for output type 'com.compuserve.gif'" again during imgData = [bmpRep representationUsingType:NSGIFFileType properties:nil];


the new imageData is stil nil... (and so writing the file fails too)
do I have to tell the bmpReb somehow, that the bitmapData changed?


Yes, there is a bit more data shuffling. Here I use your code with some insertions
as I used in my test:


if(!imgData){
//one-colered gif bug
unsigned char *bitmapData = [bmpRep bitmapData];
bitmapData[0] = (bitmapData[0] == 255) ? 254 : bitmapData[0] +1;
// insertions:
tiffData = [bmpRep TIFFRepresentation]; // tiffData with a new bitmap
NSBitmapImageRep *newRep = [NSBitmapImageRep imageRepWithData:tiffData];
// end of insertions
imgData = [newRep representationUsingType:NSGIFFileType properties:nil];
//imgData = [bmpRep representationUsingType:NSGIFFileType properties:nil];
NSLog(@"imgData: %@", imgData);
}
[imgData writeToFile:tmpFileName atomically:NO];


This is an ugly code, but for me it worked.



[view drawObjectsInRect:rect forTimeStamp:time] contains some fill/ stroke operations of NSBezierPath and a NSRectFill(rect) that fills the background color
-> so i get a background only image if no animations to fill/stroke are present



Here you could add (after creating a single color rect) the drawing of at least
a single point in another color, or draw another small NSRectFill() with a slightly other color.
This is also a bad hack but could do the job und could avoid a special gif handling.


--

Heinrich Giesen
email@hidden


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


References: 
 >Re: NSBitmapImageRep from tiff NSData bug? (From: Heinrich Giesen <email@hidden>)
 >Re: NSBitmapImageRep from tiff NSData bug? (From: Patrick Haruksteiner <email@hidden>)

  • Prev by Date: Re: Struggling with basic AppleScript support
  • Next by Date: Re: Hove to retrieve 'living' objects [CoreData / Bindings]
  • Previous by thread: Re: NSBitmapImageRep from tiff NSData bug?
  • Next by thread: CoreData/Bindings: Managed objects don't get finally deleted
  • Index(es):
    • Date
    • Thread