Thilakraj Narayana Montadka, Noida wrote: > My requirement is to read the embedded ICC profile form the input JPEG > file. > I want to know how this profile is embedded in JPEG file. Total file > structure.
Basically, see JPEG spec, ICC spec, and TIFF spec (as TIFF's mentioned in your subject line). ** JPEG ** For the spec, see http://www.w3.org/Graphics/JPEG/. Basically, JPEG is a stream of markers. Each marker starts with any number of 255 bytes, followed by one marker code byte that is not 0 nor 255. You should look up that marker code in a table. If the predefined table indicates that particular marker has no data, it is immediatelly followed by another marker. If it has data, it is followed by two bytes that indicate the data length, and the remainder of the data. Thus, you can easilly skip it if it is of no interest to you. In between a set of particular marker types, is the compressed data. Inside this compressed data, markers may again appear. Other natural occurences of the code 255 in the compressed data is replaced by the JPEG writer by a sequence of two bytes, 255 and 0. Thus, whenever you encounter a 255 byte in the compressed data, you can see if it is a marker, or not. Thus, in all, it is possible for otherwise JPEG ignorant code to scan the marker sequence. The only real JPEG knowledge the code needs is a set of 254 booleans (indicating whether data is expected for every of the marker types), and it is otherwise not that long or hard to write. This code is able to extract an ICC profile. ** TIFF ** For pointers to spec, and an informal overview of the structures much like is above for JPEG, see http://www.awaresystems.be/imaging/tiff/faq.html#q3 and http://www.awaresystems.be/imaging/tiff/faq.html#q4 Basically, you need to realize TIFF is not a streaming file format like is JPEG. TIFF is instead a random-access format. You'll need to go through a cycle of reading and decoding some structures, only to get you the file offset at which you need to read the next set of structures to decode. In the end, if you follow the pointers given in above TIFF FAQ or in spec, you end up with an ICC profile, if you go looking for that tag's data. The tag code to look for is detailed here: http://www.awaresystems.be/imaging/tiff/tifftags/iccprofile.html. (You can find such tag pages with a query such as 'icc' on the tag search page http://www.awaresystems.be/imaging/tiff/tifftags/search.html.) ** ICC profile ** For ICC spec, see http://www.color.org/. Best regards, Joris Van Damme [EMAIL PROTECTED] http://www.awaresystems.be/ Download your free TIFF tag viewer for windows here: http://www.awaresystems.be/imaging/tiff/astifftagviewer.html ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user