CODE
public void readImageHeaders(String county)
{
try {
String sql = " select image_data,id_image,dt_created,ID_VOTER from images where ID_VOTER in ('102013897','105453644') and FL_CURRENT='Y'";
ResultSet resultSet = connection.executeQuery(sql);
int id_Image=0;
File newFolder=new File("C:\\Images\\CorrectImages");
newFolder.mkdir();
while(resultSet.next())
{
id_Image = resultSet.getInt("ID_VOTER");
InputStream stream = resultSet.getBinaryStream("IMAGE_DATA");
File outputFile1 = new File("C:\\Images\\CorrectImages\\"+id_Image+".tiff");
FileOutputStream fos1 = new FileOutputStream(outputFile1);
int a1 = stream.read();
int k=0;
while (a1 >= 0) {
if(k<8)
{
System.out.print((char)a1+",");
}
if(k==8)
System.out.println("");
k++;
fos1.write((char)a1);
a1 = stream.read();
}
}
connection.commit();
}
catch (Exception sqlexcep)
{
logger.error(sqlexcep);
sqlexcep.printStackTrace();
}
}
I am trying to read the whole information about the Image File Header:IFH.(8 Bytes).
which are byte-ordering field in the IFH ,version field in the IFH ,offset in bytes from the start of the file to the Image File Directory, or IFD, structure.
How should i modify the above program do read all this information form a given image, so that i can
furthrer analyze these TIFF images.