• 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: Resizing an image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Resizing an image


  • Subject: Re: Resizing an image
  • From: Eamon Ford <email@hidden>
  • Date: Mon, 23 Jan 2006 07:48:20 -0800

Ah, that would be the problem: my image rep is an NSCachedImageRep.


On Jan 23, 2006, at 7:44 AM, Heinrich Giesen wrote:

Hello,
On 22.01.2006, at 19:42, Eamon Ford wrote:

But, I already tried that and it didn't work. When I write the file to disk, it's still the original size.


I tested my code in one of my apps with these lines:

{
id testRep = [[[myImage representations] objectAtIndex:0] copy];
// testRep must be an NSBitmapImageRep
[testRep setSize:NSMakeSize( 140, 96 )];
[[testRep TIFFRepresentation] writeToFile:@"/tmp/tstImg.tiff" atomically:YES];
[[testRep representationUsingType:NSJPEGFileType properties:nil]
writeToFile:@"/tmp/tstImg.jpg" atomically:YES];
}


and it worked.
It does not work if testRep is an NSCachedImageRep or if testRep
is built from BMP data.
Strange that you had no success.


-- Heinrich Giesen email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: Resizing an image (From: Heinrich Giesen <email@hidden>)
 >Re: Resizing an image (From: Eamon Ford <email@hidden>)

  • Prev by Date: Re: Objects cross calls
  • Next by Date: Re: Objects cross calls
  • Previous by thread: Re: Resizing an image
  • Next by thread: PDFView not displaying PDFDocument
  • Index(es):
    • Date
    • Thread