From e4b2ebd80779a44d24fe87af26ef278c1e2d97d2 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 6 Oct 2023 02:04:49 +0200 Subject: Add wrappers around boost::filesystem methods that handle the required mangling of long filenames on Windows. Also wrap lots of missing places (e.g. calls to asdcplib, libxml++, libcxml etc.) in dcp::filesystem::fix_long_path(). The idea is to keep paths un-mangled until they we call some filesystem-related API and mangle them at that point. Otherwise we end up serialising mangled names, which seems like it will not end well. Should fix DoM #2623. --- src/subtitle_image.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/subtitle_image.cc') diff --git a/src/subtitle_image.cc b/src/subtitle_image.cc index 1ef2e697..9340bc54 100644 --- a/src/subtitle_image.cc +++ b/src/subtitle_image.cc @@ -38,6 +38,7 @@ #include "equality_options.h" +#include "filesystem.h" #include "subtitle_image.h" #include "util.h" @@ -149,12 +150,12 @@ SubtitleImage::equals(shared_ptr other_sub, EqualityOptions cons note (NoteType::ERROR, "subtitle image PNG data differs"); if (options.export_differing_subtitles) { string const base = "dcpdiff_subtitle_"; - if (boost::filesystem::exists(base + "A.png")) { + if (filesystem::exists(base + "A.png")) { note (NoteType::ERROR, "could not export subtitle as " + base + "A.png already exists"); } else { png_image().write(base + "A.png"); } - if (boost::filesystem::exists(base + "B.png")) { + if (filesystem::exists(base + "B.png")) { note (NoteType::ERROR, "could not export subtitle as " + base + "B.png already exists"); } else { other->png_image().write(base + "B.png"); -- cgit v1.2.3