Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMPASS can't extract covers or open files when the file path is too long #53

Open
Mifgan opened this issue May 8, 2023 · 5 comments
Open
Assignees
Labels
bug Something isn't working Help wanted PR fixing this are welcome

Comments

@Mifgan
Copy link

Mifgan commented May 8, 2023

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).

image

image

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
@Mifgan Mifgan added the bug Something isn't working label May 8, 2023
@github-project-automation github-project-automation bot moved this to Needs review in COMPASS Roadmap May 8, 2023
@DSPaul
Copy link
Owner

DSPaul commented May 8, 2023

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.

@Mifgan
Copy link
Author

Mifgan commented May 8, 2023

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

@Mifgan
Copy link
Author

Mifgan commented May 8, 2023

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.
image

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.
image

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

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

@DSPaul
Copy link
Owner

DSPaul commented May 8, 2023

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?

@Mifgan
Copy link
Author

Mifgan commented May 8, 2023

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.

@DSPaul DSPaul changed the title COMPASS can't extract covers from certain files (pngs), mentioning that they are pdfs COMPASS can't extract covers or open files when the file path is too long May 8, 2023
@DSPaul DSPaul moved this from Needs review to Planned Short Term in COMPASS Roadmap May 8, 2023
@DSPaul DSPaul added the Help wanted PR fixing this are welcome label May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Help wanted PR fixing this are welcome
Projects
Status: Planned Short Term
Development

No branches or pull requests

2 participants