I'll also try directly modifying the RAW image and seeing what makes it into the JPEG. My concern there is that much of the RAW data is lost when converting to a JPEG, so any information I embed will likely be lost as well.
Quote from: Vegetothe1st on 04 / March / 2014, 19:06:09I'll also try directly modifying the RAW image and seeing what makes it into the JPEG. My concern there is that much of the RAW data is lost when converting to a JPEG, so any information I embed will likely be lost as well.If you want to modify the image data in filewrite, that will be very difficult since it's already jpeg compressed.
Does it matter that it's already JPEG compressed? Given that I want to embed time/date information in the photo (i.e. by modifying the LSB to contain the data), it seems that doing this on already compressed data would be preferable. Then my work won't be lost to compression, correct?
Is it possible to actually modify the image data in filewrite.c? It seems like it might be by modifying the values pointed to by the addr pointer in various chunks, but I'm not sure how you could get reliable position information for later decoding of the embedded information.
Quote from: Vegetothe1st on 05 / March / 2014, 02:13:27Does it matter that it's already JPEG compressed? Given that I want to embed time/date information in the photo (i.e. by modifying the LSB to contain the data), it seems that doing this on already compressed data would be preferable. Then my work won't be lost to compression, correct?If you fiddle with random bits in the compressed data, I would expect it to stop being a valid jpeg. Maybe that's ok in your application.QuoteIs it possible to actually modify the image data in filewrite.c? It seems like it might be by modifying the values pointed to by the addr pointer in various chunks, but I'm not sure how you could get reliable position information for later decoding of the embedded information.Filewrite gives you enough information to know the position within the file and the size of the chunk you are working with.
Quote from: reyalp on 05 / March / 2014, 03:08:44Quote from: Vegetothe1st on 05 / March / 2014, 02:13:27Does it matter that it's already JPEG compressed? Given that I want to embed time/date information in the photo (i.e. by modifying the LSB to contain the data), it seems that doing this on already compressed data would be preferable. Then my work won't be lost to compression, correct?If you fiddle with random bits in the compressed data, I would expect it to stop being a valid jpeg. Maybe that's ok in your application.QuoteIs it possible to actually modify the image data in filewrite.c? It seems like it might be by modifying the values pointed to by the addr pointer in various chunks, but I'm not sure how you could get reliable position information for later decoding of the embedded information.Filewrite gives you enough information to know the position within the file and the size of the chunk you are working with.How the data is presented in filewrite.c is the same as how it's seen when you open the JPEG in a hex editor, correct? I was going to try and create some logging files later today to ensure this was the case. If true, then I should be able to modify the bytes as long as I'm careful to avoid messing with the JPEG markers. I've noticed that overwriting any of these does make it an invalid JPEG and it can't be opened by an image viewer. I would like it to stay openable. Ideally I'd want to modify only the data in the last chunk (assuming it's not the Exif headers as was mentioned before), so that when decoding the message in the JPEG I know I can just start from the end and work backwards. Encoding elsewhere in the image (say in the third chunk rather than the last) may give me an offset from the start of the JPEG, but I wouldn't have any way of knowing this offset when trying to decode.Do you know if there are any minimum chunk sizes? Could be an issue if I'm waiting to see the last chunk and it only turns out to be a few bytes when I need a lot more.
It's definitely possible to change a few bytes and have the image be perfectly valid though, at least from my testing on standalone JPEG images that I've loaded and changed.
On a different note, I'm noticing that occasionally during my testing the camera just turns off after taking a picture.
Slightly off the topic of CHDK, but does anybody know of any easy-to-use encryption libraries that I could integrate with CHDK?
Like Phil, I'm having trouble seeing why this would be true in the general case. Unless you've actually worked out how it affects compressed data and determined the result will always be valid, just having a few examples that aren't completely broken doesn't mean much.
A first step would be to get a romlog: http://chdk.wikia.com/wiki/Debugging#Camera_crash_logs_.28romlog.29
I don't know of any specifically, but given that CHDK doesn't have access to a full ANSI C library your best bet will be something light with minimal dependencies.
Started by m3nt0r Feature Requests
Started by antitax Hello, I'm a NEWBIE - HELP!! (Newbies assistance, User Guides and thank you notes)
Started by KANKU45 General Help and Assistance on using CHDK stable releases
Started by Steveo81 « 1 2 3 4 » General Discussion and Assistance
Started by echan Hello, I'm a NEWBIE - HELP!! (Newbies assistance, User Guides and thank you notes)