I've been trying to integrate an encryption library called "libsodium" (https://github.com/jedisct1/libsodium) into CHDK and have run into some issues. I managed to cross-compile the library with arm-elf-gcc, but I'm unsure how exactly to modify the Makefiles to properly link the library against the project. So far I've made a modification to /core/Makefile to include the library in the list of dependences for main.elf, but I believe I need to do more than that; the Makefile structure is just confusing to me not having worked with such a large project in the past.I put all of the necessary headers in /include, and put the library in /lib/sodium as libsodium.a. There were some missing header files that CHDK didn't have that libsodium required, so I tried to copy them over from my local include directory; this might not be something that should be done, but it allowed the project to compile.Interestingly enough, I was able to call functions from the library in /platform/generic/filewrite.c after including the appropriate headers, but they seem to either crash the camera outright or cause the camera to misbehave (power button stops working, etc...). Any idea which Makefiles I should be modifying to correctly link this library against the project? Or do the missing headers just kill it altogether?
1. Unidentified Image on camera image viewer. The camera shows a thumbnail of the image but won't display it across the entire screen, instead claiming that it is an "Unidentified Image". Any particular reason this would occur?
There don't appear to be any visible distortions in the image, and my computer's image viewer is able to display them fine. I tried uploading JPEGs from the web to the camera and it was able to display them correctly, so it must have something to do with how I'm modifying the photos.
2. Multi-part photos. I thought I had this covered by always using the last chunk in the fwt_data_struct, but it seems that some photos call filewrite_main_hook multiple times and only save a single photo. For the photos that do this, the jpeg_file_offset changes frequently (typically starts at a high positive value, drops to -1, and then hits 0 before stopping). These images occasionally come out distorted.
Since you're not touching the Exif block, the camera can successfully decompress its small embedded thumbnail - that's what you're seeing.
You've been warned above that modifying random bits of the compressed data can easily make the JPEG stream invalid. The PC software can probably compensate for most of these errors. The camera, however, uses the DSP part of the DIGIC processor to decompress/compress JPEG data. It obviously only has to be able to decode what's in its specification (JPEG data made by Canon cameras). Your modifications to the JPEG probably trigger an exception in the DSP, which results in the error message.
I'm going to try modification of the DCT quantization tables as outlined here: http://www.guillermito2.net/stegano/jsteg/. We'll see if that fairs any better. I'm not sure if this works without re-encoding of the image, it isn't entirely made clear... It seems you'd need to re-encode it using the updated table.
Modifying the quantization tables prefaced by the (0xFF, 0xDB) marker does seem to be working. They're very limited in size, but I'm able to encode the date/time in them without an issue. These do slightly change the way the image is rendered in a viewer (I've attached a sample image where this can be seen in the black circle), but otherwise the image seems fine. The camera even recognizes it which is great.
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)