Java Doc for Exif.java in  » Web-Server » Jigsaw » org » w3c » tools » jpeg » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Server » Jigsaw » org.w3c.tools.jpeg 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.w3c.tools.jpeg.Exif

Exif
public class Exif (Code)
An API for accessing EXIF encoded information in a JPEG file.

JPEG images are stored in a tagged format reminiscent of TIFF files. Each component of the image is identified with a tag number and a size. This allows applications that read JPEG files to skip over information that they don't understand.

Additional resources:

  • Official standards, http://www.exif.org/specifications.html
  • TsuruZoh Tachibanaya's excellent description, http://www.ba.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html
  • Matthias Wandel's JHead, http://www.sentex.net/~mwandel/jhead

This class treats a byte array as a JPEG image and parses the tags searching for EXIF data. EXIF data is also tagged. Based on information provided by the caller, this class builds a hash of EXIF data and makes it available to the caller.

Most simple EXIF values are tagged with both their identity and their format. For example, ExposureTime (0x829A) is a rational number and this class can extract that value. However, some fields are of "unknown" format. If you decode one of these, you can add a special purpose decode for that field by associating the name of the decoder class with the field name. For example, my Nikon CoolPix 950 includes a MakerNote (0x927C) field that's tagged "unknown" format. Using information from TsuruZoh's page, I've built a decoder for that field and added it as an example.

In addition to the tagged data, JPEG images have five intrinisic properties: height, width, the compression algorithm used, the number of bits used to store each pixel value, and the number of color components. This class allows the caller to unify those intrinsic components with the tagged data.

In an effort to be flexible without requiring users to change the source, a fair bit of setup is needed to use this class.

The caller must:

  1. Construct an Exif object, exif = new Exif().
  2. Associate names with each of the tags of interest, exif.addTag(nnn, "name").
  3. Associate names with the intrinsic values:
    • exif.addHeight("name")
    • exif.addWidth("name")
    • exif.addCompression("name")
    • exif.addNumberOfColorComponents("name")
    • exif.addBitsPerPixel("name")
  4. Finally, the caller may associate a decoder with specific fields: exif.addDecoder("name", "java.class.name").

Having setup the exif object, it can be passed to JpegHeaders to be filled in when the JPEG file is parsed.

The caller must also explicitly set the intrinsic values since they do not come from the EXIF data.

After parsing the JPEG, call exif.getTags() to get back the has of name/value pairs.


version:
   $Revision: 1.1 $
author:
   Norman Walsh
See Also:   ExifData
See Also:   TagDecoder
See Also:   JpegHeaders




Method Summary
public  voidaddBitsPerPixel(String name)
    
public  voidaddCompression(String name)
    
public  voidaddDecoder(String name, String className)
    
public  voidaddHeight(String name)
    
public  voidaddNumberOfColorComponents(String name)
    
public  voidaddTag(int tag, String tagName)
    
public  voidaddWidth(String name)
    
protected  voidassignByte(String tagName, int offset)
    
protected  voidassignRational(String tagName, int offset)
    
protected  voidassignSByte(String tagName, int offset)
    
protected  voidassignSLong(String tagName, int offset)
    
protected  voidassignSShort(String tagName, int offset)
    
protected  voidassignString(String tagName, int offset, int length)
    
protected  voidassignULong(String tagName, int offset)
    
protected  voidassignUShort(String tagName, int offset)
    
protected  voidassignUndefined(String tagName, int offset, int length)
    
public  HashtablegetTags()
    
public  voidparseExif(byte[] exifData)
    
protected  voidprocessExifDir(int dirStart, int offsetBase)
    
public  voidsetBPP(int bitsPP)
    
public  voidsetCompression(String comp)
    
public  voidsetHeight(int height)
    
public  voidsetNumCC(int numCC)
    
public  voidsetWidth(int width)
    



Method Detail
addBitsPerPixel
public void addBitsPerPixel(String name)(Code)



addCompression
public void addCompression(String name)(Code)



addDecoder
public void addDecoder(String name, String className)(Code)



addHeight
public void addHeight(String name)(Code)



addNumberOfColorComponents
public void addNumberOfColorComponents(String name)(Code)



addTag
public void addTag(int tag, String tagName)(Code)



addWidth
public void addWidth(String name)(Code)



assignByte
protected void assignByte(String tagName, int offset)(Code)



assignRational
protected void assignRational(String tagName, int offset)(Code)



assignSByte
protected void assignSByte(String tagName, int offset)(Code)



assignSLong
protected void assignSLong(String tagName, int offset)(Code)



assignSShort
protected void assignSShort(String tagName, int offset)(Code)



assignString
protected void assignString(String tagName, int offset, int length)(Code)



assignULong
protected void assignULong(String tagName, int offset)(Code)



assignUShort
protected void assignUShort(String tagName, int offset)(Code)



assignUndefined
protected void assignUndefined(String tagName, int offset, int length)(Code)



getTags
public Hashtable getTags()(Code)



parseExif
public void parseExif(byte[] exifData)(Code)



processExifDir
protected void processExifDir(int dirStart, int offsetBase)(Code)



setBPP
public void setBPP(int bitsPP)(Code)



setCompression
public void setCompression(String comp)(Code)



setHeight
public void setHeight(int height)(Code)



setNumCC
public void setNumCC(int numCC)(Code)



setWidth
public void setWidth(int width)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.