Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8627671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:20:26+00:00 2026-06-12T08:20:26+00:00

I have an image in the camera roll. I get the data representation if

  • 0

I have an image in the camera roll. I get the data representation if the image and md5 check sum it.
We write the image to documents directory as img0.jpg
Delete the original image and write the data representation back to the camera roll using ALAssetLibrary’s writeImageDataToSavedPhotosAlbum.

Look in the photo album and the image looks to be the same.
Read the newly saved image from the camera roll again.

Expected result – mathching md5.
Actual result – different md5.

Save this file as well as img2.jpg

Hexdump the two and have a look at the difference:

Dans-Mac:Desktop dan$ hexdump img1.jpg | head
0000000 ff d8 ff e1 26 31 45 78 69 66 00 00 4d 4d 00 2a
0000010 00 00 00 08 00 05 01 1a 00 05 00 00 00 01 00 00
0000020 00 4a 01 1b 00 05 00 00 00 01 00 00 00 52 01 28
0000030 00 03 00 00 00 01 00 02 00 00 02 13 00 03 00 00
0000040 00 01 00 01 00 00 87 69 00 04 00 00 00 01 00 00
0000050 00 5a 00 00 00 b4 00 00 00 48 00 00 00 01 00 00
0000060 00 48 00 00 00 01 00 07 90 00 00 07 00 00 00 04
0000070 30 32 32 31 91 01 00 07 00 00 00 04 00 00 00 00
0000080 a0 00 00 07 00 00 00 04 30 31 30 30 a0 01 00 03
0000090 00 00 00 01 00 01 00 00 a0 02 00 04 00 00 00 01

Dans-Mac:Desktop dan$ hexdump img2.jpg | head
0000000 ff d8 ff e1 26 31 45 78 69 66 00 00 4d 4d 00 2a
0000010 00 00 00 08 00 05 01 1a 00 05 00 00 00 01 00 00
0000020 00 4a 01 1b 00 05 00 00 00 01 00 00 00 52 01 28
0000030 00 03 00 00 00 01 00 02 00 00 02 13 00 03 00 00
0000040 00 01 00 01 00 00 87 69 00 04 00 00 00 01 00 00
0000050 00 5a 00 00 00 b4 00 00 00 48 00 00 00 01 00 00
0000060 00 48 00 00 00 01 00 07 90 00 00 07 00 00 00 04
0000070 30 32 32 31 91 01 00 07 00 00 00 04 00 00 00 01
0000080 a0 00 00 07 00 00 00 04 30 31 30 30 a0 01 00 03
0000090 00 00 00 01 00 01 00 00 a0 02 00 04 00 00 00 01

If you have a look at line 0000070 the last character differ.
This is happening for some images (most) but not all tested.
In this particular case it is only one character difference in the header but other images tested faired worse with a lot of the data being different.

Is there any way at all on iOS to write actual image data to the photo library un-tainted?
With what my application is doing I rely on the md5 check sum to be the same after I have saved the image to the photo library.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T08:20:28+00:00Added an answer on June 12, 2026 at 8:20 am

    I don’t believe there is a reliable way to do this. When I was trying to use the gallery for saving PNGs with transparency, if the PNG were stored in batch from an email, they were converted to jpegs by iOS. Then I tried using iCloud with no success in preserving PNGs original format. If you’re looking for something constant try extracting the id from the URL. Then at least you know you’re working with the same thing even though the data might be changed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am saving image in the camera roll using UIImageWriteToSavedPhotosAlbum but always get an
I have a custom library that can pick mulitple images from the camera roll,
I have a UIActionSheet which has options to choose image from Camera or photo
I have image upload, where I check, how big part of image is already
So I have Image like this (source: de-viz.ru ) I want to get something
I would like to get all of the images from the camera roll and
I am having problems using choosing an image from my camera roll and assigning
I am Wrting code to capture image from camera.Below is the code I have
I have implemented the usual examples of accessing the camera roll on ipad and
I have written an application that records XVID movies from a live camera image

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.