• 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
TIFFRepresentation makes big file!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

TIFFRepresentation makes big file!


  • Subject: TIFFRepresentation makes big file!
  • From: Caroline <email@hidden>
  • Date: Thu, 11 Dec 2008 22:05:52 +0900
  • Importance: normal

Hello all,
I have some Questions.

1. I try to write NSImage to file.

NSImage *image = [NSImage imageNamed:@"test.png"];
NSBitmapImageRep *imageRep;
imageRep = [[NSBitmapImageRep alloc] initWithData:[image TIFFRepresentation]];
NSData *imageData;
imageData = [imageRep representationUsingType:NSPNGFileType properties:nil];
[imageData writeToFile:@"result.png" atomically:YES];

I got "result.png".
But!!
"result.png" has diffrent size with "test.png".

When I try to NSLog(@"image info : %@",test.png); and NSLog(@"image info : %@",result.png);
Then, test.png (original image) size is {1599.8, 1199.85} and result.png size is {1600,1200}.

Why?
Why do they have different file size?
Where is wrong? or TIFFRepresentation rounded up?

2. And, Some original/saved files have same width, height size, But they have different file size!!
 Although 'test.png' and 'result.png' are {1600,1200}, But they have 500KB(test.png) and 700KB(result.png).
 I know the PNG file doesn't compress, so I don't know why they have different file size...


3. Last one,
 when I use JPEG file, I have to know the compression of original image.
 (When I save the new image, compression is needed.)
 How can I know/get the compression of JPEG file?



Plz let me know.
ThankYou.
_______________________________________________

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

  • Follow-Ups:
    • Re: TIFFRepresentation makes big file!
      • From: Jean-Daniel Dupas <email@hidden>
  • Prev by Date: Wow - what happened to IB
  • Next by Date: Resizing an image
  • Previous by thread: Re: Wow - what happened to IB
  • Next by thread: Re: TIFFRepresentation makes big file!
  • Index(es):
    • Date
    • Thread