Re: Resizing an image
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