MarkersExtractor icon indicating copy to clipboard operation
MarkersExtractor copied to clipboard

Image File Write to Disk Fails When Filename Contains Illegal Characters

Open orchetect opened this issue 2 months ago • 2 comments

Specs

Reported in Version: 0.3.5

Issue

It appears that when the image generator module attempts to write files that have a path or filename containing illegal file-system characters, the file fails to write to disk. The extraction process seems to complete, but those particular files will be missing on disk.

It would seem to statistically occur more often when using a non-default naming mode option (since the default being projectTimecode is essentially guaranteed to never contain illegal file-system characters. But when using name or notes naming mode, it's fairly common to encounter user text that contains problematic characters.

This is found in the output log:

2024-04-30T18:21:44-0700 warning ImagesWriter : [MarkersExtractor] Error while generating image "00665 - ILA_005_0015 - Remove/Reduce snow.jpg" for marker at 01:01:18:03: Failed to add frame, with underlying error: The operation couldn’t be completed. (CINonLocalizedDescriptionKey error 3.)
2024-04-30T18:21:44-0700 warning ImagesWriter : [MarkersExtractor] Error while generating image "00666 - ILA_005_0025 - Remove/Reduce snow.jpg" for marker at 01:01:19:17: Failed to add frame, with underlying error: The operation couldn’t be completed. (CINonLocalizedDescriptionKey error 3.)
2024-04-30T18:21:44-0700 warning ImagesWriter : [MarkersExtractor] Error while generating image "00027 - ILA_018_0010 - Remove/Reduce snow.jpg" for marker at 01:03:01:08: Failed to add frame, with underlying error: The operation couldn’t be completed. (CINonLocalizedDescriptionKey error 3.)
2024-04-30T18:21:44-0700 warning ImagesWriter : [MarkersExtractor] Error while generating image "00031 - ILA_013_0015 - Add plane wheel (optional) - Remove/Reduce snowfall - Add mountains in BG.jpg" for marker at 01:03:51:05: Failed to add frame, with underlying error: The operation couldn’t be completed. (CINonLocalizedDescriptionKey error 3.)
2024-04-30T18:21:44-0700 warning ImagesWriter : [MarkersExtractor] Error while generating image "00035 - ILA_017_0010 - add CG plane - Binoculars - Remove/Reduce snowfall.jpg" for marker at 01:04:05:09: Failed to add frame, with underlying error: The operation couldn’t be completed. (CINonLocalizedDescriptionKey error 3.)
2024-04-30T18:21:44-0700 warning ImagesWriter : [MarkersExtractor] Error while generating image "00036 - ILA_017_0020 - add CG plane - Boy must be shorter - Remove/Reduce snowfall.jpg" for marker at 01:04:19:08: Failed to add frame, with underlying error: The operation couldn’t be completed. (CINonLocalizedDescriptionKey error 3.)
2024-04-30T18:21:44-0700 warning ImagesWriter : [MarkersExtractor] Error while generating image "00033 - ILA_013_0025 - Add wheel (omitted) - Reduce/Remove falling snow - Add mountains in BG.jpg" for marker at 01:04:00:17: Failed to add frame, with underlying error: The operation couldn’t be completed. (CINonLocalizedDescriptionKey error 3.)
2024-04-30T18:21:44-0700 warning ImagesWriter : [MarkersExtractor] Error while generating image "00038 - ILA_017_0030 - add CG plane - Binoculars - Remove/Reduce falling snow.jpg" for marker at 01:04:30:22: Failed to add frame, with underlying error: The operation couldn’t be completed. (CINonLocalizedDescriptionKey error 3.)

The common denominator in these errors is a forward-slash character (/) in the filename portion of the path.

Solution

  1. The filename needs to be sanitized during the extraction process by replacing illegal characters with a placeholder such as - or _.
  2. This sanitized filename needs to be used in the export manifest for Image Filename field, in addition to being used when writing the image file to disk.

orchetect avatar May 01 '24 01:05 orchetect