title: Same Files Are in Different Size in IPAD1 and IPAD2 When I Retrieved Using ALAsset Block
body: <p>I have synced an image  to 2 Ipads (Let Say IPAD1 and IPAD2) through ITunes.
  Then ,when i retrieved the images using ALAssetLibrary block , the file size is different in 2 Ipads .</p>
  
  <p>(IPAD1 File size: 0.024059,IPAD2 File size: 0.024325).</p>
  
  <p>May i know, why the same files are in different size in  IPAD1 and IPAD2?</p>
  
  <p>However i saved an image to IPAD1 and IPAD2 through the safari browser,by tapping the image from the same webpage,i got same file size for the image in Ipad1 and Ipad2 when i retrieved through ALAssetLibarary.</p>
  
  <p>Please tell me your valuable suggestions....</p>
  
  <p>Usage</p>
  
  <hr>
  
  <pre><code>I am doing the image comparison in Ipad PhotoLibrary.
  Whenever an Image transfer request is coming from another device, i have to test the image file exist in PhotoLibrary.
  So mentor image request will have CRC code of the requested image which will uneque for the same image file and i am generating the CRC code for all my photoLibrary images and comparing it with the requested image CRC code.
  So whenever these 2 CRC's are equal , i can easily identify the files are same.
  </code></pre>
  
  <p>The code i used for retrieving PhotoLibrary Image is:</p>
  
  <pre><code>ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset)
    {
     ALAssetRepresentation *rep = [myasset defaultRepresentation];
  
     NSLog(@"GOT ASSET, File size: %f", [rep size] / (1024.0f*1024.0f));
  
     uint8_t* buffer = malloc([rep size]);
  
     NSError* error = NULL;
  
     NSUInteger bytes = [rep getBytes:buffer fromOffset:0 length:[rep size] error:&amp;error];
  
         if (bytes == [rep size])
         {   
  
              defaultRepresentationData = [[NSData dataWithBytes:buffer length:bytes] retain];
  
              CGImageRef iref = [rep fullResolutionImage];
              UIImage *photLibraryImage  = [UIImage imageWithCGImage:iref];
  
  
               NSData *imageData = UIImagePNGRepresentation(photLibraryImage); //convert image into .png format.
               const int imageCRC = [self CRCForImage:imageData]]; //getting CRC value for image data
  
               NSLog([NSString stringWithFormat:@"@@@@@@@@ image CRC is:%u",imageCRC ]);       
  
         }
         else
         {
              NSLog(@"Error '%@' reading bytes from asset: '%@'", [error localizedDescription]); //assetURL);
         }
  
     free(buffer);
  
     // notifies the lock that "all tasks are finished"
  
    };
  
       //
        ALAssetsLibraryAccessFailureBlock failureblock  = ^(NSError *myerror)
        {
             NSLog(@"NOT GOT ASSET");  
        };
  
    NSURL *asseturl = [NSURL URLWithString:fileName]; 
  
     ALAssetsLibrary* assetslibrary = [[[ALAssetsLibrary alloc] init] autorelease];
     [assetslibrary assetForURL:asseturl  resultBlock:resultblock  failureBlock:failureblock];    
  
   }
  </code></pre>
  
  <p>The   NSLog(@"GOT ASSET, File size: %f", [rep size] / (1024.0f*1024.0f)); printing different values for same file in different devices.</p>
  
  <p>Console Log Details</p>
  
  <hr>
  
  <p>Ipad1</p>
  
  <hr>
  
  <p>GOT ASSET, File size: 0.024059
  image CRC is:2659650838</p>
  
  <p>Ipad2</p>
  
  <hr>
  
  <p>GOT ASSET, File size: 0.024325
  @@@@@@@@image CRC is:331786167</p>
  
  <p>IPAD VERSION DETAILS</p>
  
  <hr>
  
  <p>IPAD1:
      Version: 4.2.1(8C148)
      Model: MB292LL</p>
  
  <p>IPAD2:
      Version: 4.3.5(8L1)
      Model: MB292LL</p>
  
  <p>Thanks.</p>