Hi guys, Remember 41 0a 01 00 0a 00 00 00 as the download command for picture 1 ? pic-headers.txt was right about the number of bulk packets, but there is a tricky thing going on. If the picture has more than 99 bulk packets (only SOME low quality pictures, almost ALL medium and high quality pictures), you can send: 41 0a 01 00 0b 00 00 00 (Notice 0x000A is now 0x000B in usb_control_msg) and the camera will send you the first 99 bulk packets of the picture only. The idea is that the thumbnail part of the EXIF comes first, and is always somewhere within the first 99 bulks. So you can ask for the first 99 bulk packets of a picture to get the thumbnail out of the Exif (if we knew how :-)) and then get the entire picture at a later time. I also included the number of pictures, detection of internal memory / compactflash, and picture quality resolution into a download program. It will show the info, and extract all pictures, picture header to pictureinfo.1.txt thumbnail (if more than 99 bulks) to thumbnail1.jpg and picture (always) to picture1.jpg The thumbnail is not viewable, because the "main" JPEG info is missing, however there IS a thumbnail inside it if we can extract it. It also has the BCD encoding and decoding, so that if the camera says it has 0x10 pictures, it will convert it to 10 (and not 16), and when you download picture 11 it will convert it to 0x11 for the camera. Basically, it will download all pictures off a compactflash cleanly. Example output for downloading: ----------------------------------------------------------- root_at_dennis testing # ./a.out Agfa CL20 utility $Id$ Experimenting with the CL20 USB protocol... Please press the Agfa PRINT button to continue... Camera is using a CompactFlash memory card, good! There are 7 pictures on your CL20 Getting picture information... * Picture 1 is a low quality shot consisting of 232 / 0xE8 bulk transfers (59392 bytes) Downloading ./picture1.jpg... completely * Picture 2 is a high quality shot consisting of 440 / 0x1B8 bulk transfers (112640 bytes) Downloading ./thumbnail2.jpg... as a thumbnail Downloading ./picture2.jpg... completely * Picture 3 is a high quality shot consisting of 552 / 0x228 bulk transfers (141312 bytes) Downloading ./thumbnail3.jpg... as a thumbnail Downloading ./picture3.jpg... completely * Picture 4 is a high quality shot consisting of 448 / 0x1C0 bulk transfers (114688 bytes) Downloading ./thumbnail4.jpg... as a thumbnail Downloading ./picture4.jpg... completely * Picture 5 is a medium quality shot consisting of 232 / 0xE8 bulk transfers (59392 bytes) Downloading ./thumbnail5.jpg... as a thumbnail Downloading ./picture5.jpg... completely * Picture 6 is a medium quality shot consisting of 296 / 0x128 bulk transfers (75776 bytes) Downloading ./thumbnail6.jpg... as a thumbnail Downloading ./picture6.jpg... completely * Picture 7 is a low quality shot consisting of 40 / 0x28 bulk transfers (10240 bytes) Downloading ./picture7.jpg... completely ----------------------------------------------------------- Not yet in CVS, but will be soon. Another example (storage detection): ---------------------------------------------------------------------------------------------------------------------- root_at_dennis testing # ./a.out Agfa CL20 utility $Id$ Experimenting with the CL20 USB protocol... Please press the Agfa PRINT button to continue... While your CL20 camera has 3 pictures on it, these pictures are stored on the internal memory, not on a compactflash card. Currently we do not yet know the format for images stored in the camera's internal memory. Sorry! ---------------------------------------------------------------------------------------------------------------------- Regards, Dennis :-)Received on Sun Sep 08 2002 - 21:36:06 CEST
This archive was generated by hypermail 2.2.0 : Tue Oct 20 2009 - 17:33:19 CEST