C++ Interface hangs

Started by Sebastian Fischer, October 04, 2023, 10:49:05 AM

Previous topic - Next topic

Sebastian Fischer

Hi,

The C++ interface for ExifTool hangs with a corrupted JPG image when used on macOS (intel) or Linux.

I had a look into the C++ interface code and it seems like the issue is the unix pipe for stdout that does not receive a response.

I do get a correct response (some warnings and the "ready" token) when I start the exiftool manually on the command line and use the same arguments and options that the interfaces uses.

Is there a know issue like this?

Best regards
Sebastian Fischer

Sebastian Fischer

The problem occurs only with one damaged jpg file. I was not able to reproduce it with other images. Unfortunately I am not allowed to share this image.

Furthermore, it only happens, when I specify the metadata fields I want to read (e.g. "-EXIF:all"). Because there is no Exif metadata in the file, the ExifTool output contains no metadata but some warnings.

When I edit the C++ Interface in a way, that let the ExifTool write it's output (STDOUT_FILENO and STDERR_FILENO) to a file instead of the pipe, the file contains the correct output. With the original code, the pipe does not receive anything, wich leads to the hang.

I was able to work around the problem: In addition to the metadata fields I want to read, I also specify "-ExifTool:all" to force the ExifTool to always write some metadata (warnings, if any, and at least it's own version). In this case, the pipe does receive data.

Phil Harvey

Thanks.  I'll look into this when I get a chance.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).