• 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: CMYK Text of Photoshop Layer rendered incorrectly
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CMYK Text of Photoshop Layer rendered incorrectly


  • Subject: Re: CMYK Text of Photoshop Layer rendered incorrectly
  • From: Thorsten Lemke <email@hidden>
  • Date: Mon, 18 Oct 2010 15:35:25 +0200
  • Thread-topic: CMYK Text of Photoshop Layer rendered incorrectly

Hi Peter,

I suggest to use the Core Image Import:
    CGImageSourceRef imageSource =
        CGImageSourceCreateWithURL((CFURLRef)[NSURL fileURLWithPath:path],
NULL);
....

That does handle CMYK, too.

Thorsten


> Von: Peter Krajčík <email@hidden>
> Datum: Mon, 18 Oct 2010 14:53:10 +0200
> An: <email@hidden>
> Betreff: CMYK Text of Photoshop Layer rendered incorrectly
>
> Hi,
>
> I am reading Photoshop layer images using this approach:
>
> (simplified code)
>
> for (i=0; i <= imageCount; i++)
> {
> unsigned long offset, size;
> GraphicsImportSetImageIndex(importer, i);
> GraphicsImportGetDataOffsetAndSize(importer, &offset, &size);
>
> // create a Graphics Exporter component that will write Photoshop data
> OSErr err =
> OpenADefaultComponent(GraphicsExporterComponentType,kQTFileTypePhotoShop,
> &exporter);
>
> if (err == noErr)
> {
>      // set export parameters
>      Handle bmpDataH = NewHandle(0);
>      GraphicsExportSetInputGraphicsImporter(exporter, importer);
>      GraphicsExportSetOutputHandle(exporter, bmpDataH);
>
>      // export data to BMP into handle
>      unsigned long actualSizeWritten = 0;
>      err = GraphicsExportDoExport(exporter, &actualSizeWritten);
>
>           if (err == noErr)
>           {
>
>                HLock(bmpDataH);
>
>                //create a simple image with the tiff data, without the bound
> information, its rep will stored to layer as CGImageRef
>                id image = [CIImage imageWithData:[NSData
> dataWithBytes:*bmpDataHlength:GetHandleSize(bmpDataH)]];
>                NSBitmapImageRep* rep = [[[NSBitmapImageRep alloc]
> initWithCIImage:image]autorelease];
>
>                CGImageRef imageRef = rep.CGImage;
>                self.layerImage =CGImageRetain(imageRef);
>                HUnlock(bmpDataH);
>          }
>
>      DisposeHandle(bmpDataH);
>      CloseComponent(exporter);
>      }
>
> }


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

References: 
 >CMYK Text of Photoshop Layer rendered incorrectly (From: Peter Krajčík <email@hidden>)

  • Prev by Date: CMYK Text of Photoshop Layer rendered incorrectly
  • Next by Date: Re: Heapshot Analysis to find Memory Accretion (Leaks)
  • Previous by thread: CMYK Text of Photoshop Layer rendered incorrectly
  • Next by thread: Re: CMYK Text of Photoshop Layer rendered incorrectly
  • Index(es):
    • Date
    • Thread