• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Tiff Image

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everyone.

I need to get the format type for a each image in a folder and then change the format to a different type and then merge them. My problem is that I dont know how to get the type from an Image. I have googled it and found nothing really to what I need and I dont know if I understand it correctly. Can someone help me by guiding me in the right direction? Or some pointers?

Thanks
Michelle
 
Marshal
Posts: 27371
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, there are hundreds of different graphics file formats. And the only way to tell whether a particular file belongs to one of those hundreds of formats is to look at the bytes of the file and see if those bytes match the rules for the format in question.

As you can imagine this isn't an easy task. For example here's a link to what I think is the TIFF specs -- I got that from a link on the Wikipedia page about TIFF, Tagged Image File Format. That document tells you how to arrange the bytes in a file so that they represent a TIFF document, and you should then be able to use the document when you look at a file, to see if its bytes match the rules in that document.

So that's one format. If you have other formats you want to recognize, you're going to have to track down the specs for them as well.
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See "How can I check the type of an image file?" in the JavaIoFaq. It should provide a starting point.
 
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic