COMPASS can't extract covers or open files when the file path is too long
Describe the bug
When importing a folder with map files (.png in this case) COMPASS will try to extract covers of all files.
It will give an error in activity log for certain images (not all) saying it can't extract a cover of these pdfs.
Since the files are images, it COMPASS should maybe recognise them as such. Weirdly enough, some covers are correct, some are just missing and a bunch are something else entirely (images not in the file).


Expected behaviour
They should all have either the correct image (see second screenshot blue square), or Cover Art Unavailable.
System info (please complete the following information):
- OS: W10
- Release Version V1.4.2
I might be reading over it but I don't see where it states in the error the it thinks the file is a pdf, it just states that it fails to get the cover which I agree is weird wording when it comes to images because the error message is the same regardless or filetype so I will definitely rephrase that error to state that it failed to get a preview/thumbnail rather than a cover in the case of images. As for why it failed, can you share your log file? It should contain more information that will reveal the underlying issue.
Have you also tried editing the file in COMPASS and clicking "Fetch" underneath the cover? This should get COMPASS to try getting the image again. If that works, the reason it failed earlier is probably a result of the image being open in other program or something like that, but if it fails again, it might be something specific to the file.
Oh, mea culpa. I see that the specific Failed to extract Cover from pdf wasn't included in the screenshot.
I dug out the relevant bit out of the logs.
2023-05-08 06:49:29,117 ERROR method: COMPASS.Tools.Logger Error - Could not get cover from \\Carnyx\Books\Tabletop and Board Games\Tabletop RPG's\Systems\Call of Cthulhu\Modules\1920s\Doors to Darkness\Cthulhu Architect [Cthulhu Maps - Scenario Map Pack 01] The Darkness Beneath the Hill [2021-04-16]\70 PPI 2\3d - Josh Winscott House - First Floor - Night.png
ImageMagick.MagickBlobErrorException: unable to open image '\\Carnyx\Books\Tabletop and Board Games\Tabletop RPG's\Systems\Call of Cthulhu\Modules\1920s\Doors to Darkness\Cthulhu Architect [Cthulhu Maps - Scenario Map Pack 01] The Darkness Beneath the Hill [2021-04-16]\70 PPI 2\3d - Josh Winscott House - First Floor - Night.png': No such file or directory @ error/blob.c/OpenBlob/3569
at ImageMagick.NativeInstance.CheckException(IntPtr exception, IntPtr result) in /_/src/Magick.NET/Native/NativeInstance.cs:line 63
at ImageMagick.MagickImage.NativeMagickImage.ReadFile(IMagickSettings`1 settings) in /_/src/Magick.NET/Native/MagickImage.cs:line 7137
at ImageMagick.MagickImage..ctor(String fileName) in /_/src/Magick.NET/MagickImage.cs:line 199
at COMPASS.Tools.CoverFetcher.GetCoverFromImage(String imagepath, Codex destfile) in C:\Users\pauld\Documents\COMPASS\src\Tools\CoverFetcher.cs:line 132
2023-05-08 06:49:42,088 ERROR method: COMPASS.Tools.Logger Error - Failed to extract Cover from pdf.
I also added the full log in attachment, the above example is on lines 16.891 - 16.897. all.log
When fetching the cover of a file with a strange cover (image not really related to the file), it gives me following error in the activity log.

When double clicking one of those files in COMPASS to open it, it shows the Windows dialog as if the file is in a format it doesn't know.

The log says the file was opened (but I reckon that's because of it registering the file was double clicked on).

Meanwhile through my explorer, the file opens without any hassle.

That is very bizarre, can you send me that png file to check out? And does it happen with all png's from that folder or only a few?
It happens with maybe 75% of the png's from that folder. The other 25% has no cover, except one file where it generated correctly (the Roof - Day file in the first screenshot).
I'll send it through Discord.