Might also depend on camera resolution the G12 is only 10MP compared to the A3200 14MP.
Could be, or some related Canon code can be different. My identification was based on the presence of '0x8000' in that part of the fwt code. I managed to make a multipass JPEG at the camera's 7MP setting - I'm using a fine black/white grid displayed on the monitor to torture the JPEG engine.
Haven't reproduced it yet, will keep testing.
I think the OFLAG_APPEND bit (0x8000) may be more related to calling a different version of Close, than indicating that the file is being appended. Perhaps an optimised code path.
Have you tried checking the 'flags' parameter to 'open' to see if the O_APPEND flag is set or not?
(Don't forget the value of O_APPEND differs between VxWorks and DryOS).For a multi-pass image save, I would expect the final file update would not have O_APPEND set, since it would need to re-write the file header.
If you combine OFLAG_APPEND, 'flags' & O_APPEND, and a test of the very first chunk for a JPEG file header, then there might be enough information to determine if a multi-pass save is happening and detect the last segment.
This is all speculation at the moment, I'll do some more experiments and testing when I get a chance.
Phil.
Edit: back at a computer now, and looking at this in more detail. In this post
http://chdk.setepontos.com/index.php?topic=4338.msg111230#msg111230 you show the fwt_data from a normal and multi-pass image save.
From these it looks like:
- oflags & 0x300 == 0x300 --> first or only invocation for file
- oflags & 0x308 == 0x008 --> appending to file (O_APPEND)
- oflags & 0x308 == 0x000 --> last invocation for file
So the problem is how to determine if this is a single or multi-pass file save - in this case examining the first chunk of memory for a JPEG header should work.
Phil.