Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (407)
games submitted by our members
Games in WIP (293)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Jpeg comments  (Read 1176 times)
0 Members and 1 Guest are viewing this topic.
Offline appel

JGO Ninja


Medals: 35
Projects: 5


I always win!


« Posted 2006-11-30 17:33:38 »

Perhapse not strongly game-related, I'm trying to modify the Exif headers in Jpeg images... that is I want to add comments into the file.

I already have a way of reading a input stream and modifying it, and then stream it into a outputstream. But this will create a new file, which i don't want.

Isn't there a way to simply open up a Jpeg file, add the comment, and then store it... without reading the whole file and creating a new file?



Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline Eli Delventhal
« League of Dukes »

JGO Kernel


Medals: 39
Projects: 12


Game Engineer


« Reply #1 - Posted 2006-11-30 18:07:26 »

As far as I know –
No.

I made a program just to rename some images I had en masse, and all I could do was read in the .jpg and then rewrite it out as a completely new image with my chosen name. It was kind of slow and kind of a pain, but I could just leave the program running, go and do something else, then in 10 minutes or so I'd have a few hundred renamed images (this was for categorizing images on my camera and from my scanner, mostly).

It would have been much easier if I could have just modified each image, but I really don't think that's possible. If you edit and then save an image in Photoshop it often saves a copy and replaces the old one, so it seems to me this is undoable.

But if someone says otherwise, I will be very happy.

See my work:
OTC Software
Offline tusaki

Junior Member




In a mad world only the mad are sane.


« Reply #2 - Posted 2006-12-01 12:06:03 »

well if exif headers were fixed length you could use RandomAccessFile to read and manipulate just the headers. if it is some random-length string, then you are forced to update the rest of the file as well since you can't just 'insert' bytes. (technically if you had access to the underlying filesystem, you could just update the file allocation tables)
Games published by our own members! Check 'em out!
Try the Free Demo of Titan Attacks
Offline appel

JGO Ninja


Medals: 35
Projects: 5


I always win!


« Reply #3 - Posted 2006-12-01 14:14:33 »

Ok, thanks for your replies.

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars and Titan!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (97 views)
2013-05-17 21:29:12

alaslipknot (105 views)
2013-05-16 21:24:48

gouessej (135 views)
2013-05-16 00:53:38

gouessej (130 views)
2013-05-16 00:17:58

theagentd (142 views)
2013-05-15 15:01:13

theagentd (128 views)
2013-05-15 15:00:54

StreetDoggy (171 views)
2013-05-14 15:56:26

kutucuk (192 views)
2013-05-12 17:10:36

kutucuk (195 views)
2013-05-12 15:36:09

UnluckyDevil (201 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.074 seconds with 20 queries.