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

on Windows fetchart gives errors verifying size even though ImageMagick is installed #1721

Closed
richardpowellus opened this issue Nov 15, 2015 · 26 comments
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."

Comments

@richardpowellus
Copy link

Just before running "beet import..." I type "convert" in the same Shell and verify that it is ImageMagick (i.e. it's in the path, etc.).

However fetchart still says: 'fetchart: could not verify size of image: please see documentation for dependencies. The configuration options minwidth and enforce_ratio may be violated.'

@sampsyo sampsyo added the needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature." label Nov 15, 2015
@sampsyo
Copy link
Member

sampsyo commented Nov 15, 2015

Thanks for reporting. Can you please expand with a little more detail about what you were expecting to happen and what isn't working?

Configuration details and system setup information would also be helpful.

@sampsyo
Copy link
Member

sampsyo commented Nov 15, 2015

I should have mentioned: a verbose log would also help give a glimpse at what's going on.

@Schweinepriester
Copy link
Contributor

+1, Pillow is also installed. Will provide config/system/verbose details later :)

@Schweinepriester
Copy link
Contributor

System: Windows 10 Education Version "1511"
Config: http://pastebin.com/02ejcsTw

Portion from beet -vv import:

fetchart: using well-named art file Front.jpg
artresizer: method is (2, (6, 9, 2))
IM cannot compute size of c:\users\kai\appdata\local\temp\tmpzhhit6\2001.03.At Dawn\Front.jpg
fetchart: could not verify size of image: please see documentation for dependencies. The configuration options `minwidth
` and `enforce_ratio` may be violated.
fetchart: found local image c:\users\kai\appdata\local\temp\tmpzhhit6\2001.03.At Dawn\Front.jpg
fetchart: trying source coverart for album My Morning Jacket - At Dawn
fetchart: downloading image: http://coverartarchive.org/release/f442ad7a-28c7-48dc-9805-14fbb94134dc/front
fetchart: not a supported image: text/html
fetchart: downloading image: http://coverartarchive.org/release-group/39deaf5d-3761-33ab-92ae-0d38f35fa64e/front
fetchart: not a supported image: text/html
fetchart: trying source amazon for album My Morning Jacket - At Dawn
fetchart: trying source albumart for album My Morning Jacket - At Dawn
fetchart: trying source google for album My Morning Jacket - At Dawn
fetchart: getting URL: https://ajax.googleapis.com/ajax/services/search/images?q=My+Morning+Jacket%2CAt+Dawn&start=0&v=1
.0
fetchart: downloading image: https://i.ytimg.com/vi/qqLsdp2k5gA/hqdefault.jpg
fetchart: downloaded art to: c:\users\kai\appdata\local\temp\tmpprvm_n.jpg
IM cannot compute size of c:\users\kai\appdata\local\temp\tmpprvm_n.jpg
fetchart: could not verify size of image: please see documentation for dependencies. The configuration options `minwidth
` and `enforce_ratio` may be violated.
fetchart: using remote image c:\users\kai\appdata\local\temp\tmpprvm_n.jpg
fetchart: error scraping art page
artresizer: ImageMagick resizing c:\users\kai\appdata\local\temp\tmpprvm_n.jpg to c:\users\kai\appdata\local\temp\tmps9l
nec.jpg
artresizer: IM convert failed for c:\users\kai\appdata\local\temp\tmpprvm_n.jpg

ImageMagick:

PS E:\Desktop> convert
Version: ImageMagick 6.9.2-5 Q16 x64 2015-10-31 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180031101
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib
Usage: convert.exe [options ...] file [ [options ...] file ...] [options ...] file

Image Settings:
  -adjoin              join images into a single multi-image file
  -affine matrix       affine transform matrix
[…]

Pip:

PS E:\Desktop> pip list
beets (1.3.15)
colorama (0.3.3)
discogs-client (2.2.1)
enum34 (1.0.4)
jellyfish (0.5.1)
munkres (1.0.7)
musicbrainzngs (0.5)
mutagen (1.31)
oauthlib (1.0.3)
Pillow (3.0.0)
pip (7.1.2)
pylast (1.4.2)
PyYAML (3.11)
rarfile (2.7)
requests (2.8.1)
setuptools (16.0)
six (1.10.0)
Unidecode (0.4.18)

If further information is needed, I'm happy to provide :)

sampsyo added a commit that referenced this issue Nov 21, 2015
@sampsyo
Copy link
Member

sampsyo commented Nov 21, 2015

Thanks, @Schweinepriester! I just pushed an update that should log more descriptive exceptions when things go wrong. Could you try again and see what the log gives you this time?

@Schweinepriester
Copy link
Contributor

Yes! :)

PS E:\Desktop\beets-master\beets-master> python .\beet -vv import […]
[…]
Sending event: database_change
fetchart: trying source coverart for album Space Bong - Deadwood To Worms
artresizer: method is (2, (6, 9, 2))
fetchart: downloading image: http://coverartarchive.org/release/ea4531aa-2c75-4fcc-8932-cc648dea3e8e/front
fetchart: not a supported image: text/html
fetchart: downloading image: http://coverartarchive.org/release-group/9e486ef4-8613-4d73-88ea-8bf19f9b6962/front
fetchart: not a supported image: text/html
fetchart: trying source amazon for album Space Bong - Deadwood To Worms
fetchart: trying source albumart for album Space Bong - Deadwood To Worms
fetchart: trying source google for album Space Bong - Deadwood To Worms
fetchart: getting URL: https://ajax.googleapis.com/ajax/services/search/images?q=Space+Bong%2CDeadwood+To+Worms&start=0&
v=1.0
fetchart: downloading image: https://f1.bcbits.com/img/0005861258_10.jpg
fetchart: downloaded art to: c:\users\kai\appdata\local\temp\tmpp0blfw.jpg
Traceback (most recent call last):
  File "C:\Python27\lib\logging\__init__.py", line 859, in emit
    msg = self.format(record)
  File "C:\Python27\lib\logging\__init__.py", line 732, in format
    return fmt.format(record)
  File "C:\Python27\lib\logging\__init__.py", line 471, in format
    record.message = record.getMessage()
  File "C:\Python27\lib\logging\__init__.py", line 331, in getMessage
    msg = str(self.msg)
  File "E:\Desktop\beets-master\beets-master\beets\logging.py", line 86, in __str__
    return self.msg.format(*args, **kwargs)
ValueError: cannot switch from automatic field numbering to manual field specification
Logged from file artresizer.py, line 129
fetchart: Could not get size of image (please see documentation for dependencies). The configuration options `minwidth`
and `enforce_ratio` may be violated.
fetchart: using remote image c:\users\kai\appdata\local\temp\tmpp0blfw.jpg
fetchart: error scraping art page
lyrics: failed to fetch: http://lyrics.wikia.com/Space_Bong:Slow_Spring (404)
[…]

Seems to be something wrong with the logging? Just guessing :)

sampsyo added a commit that referenced this issue Nov 22, 2015
@sampsyo
Copy link
Member

sampsyo commented Nov 22, 2015

Oh no; that was totally my fault—I messed up the changes to the logging. Can I ask you to run this one more time?

@Schweinepriester
Copy link
Contributor

Sure thing :)

PS E:\Desktop\beets-master> python .\beet -vv import […]
[…]
Sending event: database_change
fetchart: using well-named art file cover.jpg
artresizer: method is (2, (6, 9, 2))
ImageMagick invocation failed when getting size with command ['identify', '-format', '%w %h', u'\\\\?\\c:\\users\\kai\\a
ppdata\\local\\temp\\tmpwqdpb9\\Rotor - Funf (2015)\\cover.jpg']: Command 'identify -format %w %h \\?\c:\users\kai\appda
ta\local\temp\tmpwqdpb9\Rotor - Funf (2015)\cover.jpg' returned non-zero exit status 1
fetchart: Could not get size of image (please see documentation for dependencies). The configuration options `minwidth`
and `enforce_ratio` may be violated.
fetchart: found local image c:\users\kai\appdata\local\temp\tmpwqdpb9\Rotor - Funf (2015)\cover.jpg
fetchart: trying source coverart for album RotoR - Fünf
fetchart: downloading image: http://coverartarchive.org/release/4f259ba0-7ae2-479d-bb10-b910e504cd76/front
fetchart: not a supported image: text/html
fetchart: downloading image: http://coverartarchive.org/release-group/107634bf-0713-4190-9670-22bcf5f5df21/front
fetchart: not a supported image: text/html
fetchart: trying source amazon for album RotoR - Fünf
fetchart: trying source albumart for album RotoR - Fünf
fetchart: trying source google for album RotoR - Fünf
fetchart: getting URL: https://ajax.googleapis.com/ajax/services/search/images?q=RotoR%2CF%C3%BCnf&start=0&v=1.0
fetchart: downloading image: http://morefuzz.net/wp-content/uploads/2015/10/Rotor-funf.jpg
fetchart: downloaded art to: c:\users\kai\appdata\local\temp\tmpwli1ny.jpg
ImageMagick invocation failed when getting size with command ['identify', '-format', '%w %h', u'\\\\?\\c:\\users\\kai\\a
ppdata\\local\\temp\\tmpwli1ny.jpg']: Command 'identify -format %w %h \\?\c:\users\kai\appdata\local\temp\tmpwli1ny.jpg'
 returned non-zero exit status 1
fetchart: Could not get size of image (please see documentation for dependencies). The configuration options `minwidth`
and `enforce_ratio` may be violated.
fetchart: using remote image c:\users\kai\appdata\local\temp\tmpwli1ny.jpg
fetchart: error scraping art page
lyrics: failed to fetch: http://lyrics.wikia.com/Rotor:Scheusal (404)
[…]
PS E:\Desktop\beets-master> identify
Version: ImageMagick 6.9.2-5 Q16 x64 2015-10-31 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180031101
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib
Usage: identify.exe [options ...] file [ [options ...] file ... ]

Image Settings:
  -alpha option        on, activate, off, deactivate, set, opaque, copy
                       transparent, extract, background, or shape
  -antialias           remove pixel-aliasing
[…]

@sampsyo
Copy link
Member

sampsyo commented Nov 22, 2015

OK! We're getting closer. Can you try running the command that errored out to see if it gives you any more details?

identify -format '%w %h' \\?\c:\users\kai\appdata\local\temp\tmpwqdpb9\Rotor - Funf (2015)\cover.jpg

or, because that temporary file is likely to be gone already, point it toward some other image for testing.

There's a chance that ImageMagick doesn't support the \\?\-prefixed extended paths, in which case we might be out of luck.

@Schweinepriester
Copy link
Contributor

PS C:\Users\Kai> identify -format '%w %h' \\?\c:\users\kai\appdata\local\temp\tmpwqdpb9\Rotor - Funf (2015)\cover.jpg
PS C:\Users\Kai> identify -format '%w %h' \\?\UNC\c:\users\kai\appdata\local\temp\tmpwqdpb9\Rotor - Funf (2015)\cover.jp
g
PS C:\Users\Kai> identify -format '%w %h' c:\users\kai\appdata\local\temp\tmpwqdpb9\Rotor - Funf (2015)\cover.jpg
PS C:\Users\Kai> identify -format '%w %h' "\\?\c:\users\kai\appdata\local\temp\tmpwqdpb9\Rotor - Funf (2015)\cover.jpg"
1477 1429PS C:\Users\Kai> identify -format '%w %h' \\?\'c:\users\kai\appdata\local\temp\tmpwqdpb9\Rotor - Funf (2015)\co
ver.jpg'
1477 1429PS C:\Users\Kai> identify -format '%w %h' '\\?\c:\users\kai\appdata\local\temp\tmpwqdpb9\Rotor - Funf (2015)\co
ver.jpg'
1477 1429PS C:\Users\Kai> identify -format '%w %h' \\?\c:\users\kai\appdata\local\temp\tmpwqdpb9\test.jpg
1477 1429PS C:\Users\Kai>

I canceled the first three because nothing was happening - with "…" or '…', even in different places, or no spaces at all, it appears to be working! :)

Links i found while searching for \\?\-prefixed extended paths:

Two options came to my mind:

  1. At least on Windows, put everything in ' or "
  2. At least on Windows, remove every space from the temp-path

I believe at least the second wouldn't cause trouble on other OSs, since its temp anyway?

Are there other options? :)

@sampsyo
Copy link
Member

sampsyo commented Nov 23, 2015

Thanks for trying this out! Actually, the quoting thing shouldn't be a problem for the way we're executing the command... since we're bypassing the shell's parser and passing the entire path as a unit, we shouldn't need to worry about escaping.

So this command that you ran:

identify -format '%w %h' "\\?\c:\users\kai\appdata\local\temp\tmpwqdpb9\Rotor - Funf (2015)\cover.jpg"

is probably the closest to what beets is actually doing. And it worked! So I'm a bit mystified about what's going wrong.

I should have access to a Windows box pretty soon. I'll see if I can reproduce this and dig a little deeper.

Thanks again for your cooperation!

@Schweinepriester
Copy link
Contributor

Alright!

I'm happy (and selfish) to help :) B-)

If I can assist further, just let me know.

@sampsyo
Copy link
Member

sampsyo commented Nov 24, 2015

Well, depressingly, I wasn't able to reproduce this. On my Windows 10 machine, ImageMagick 6.9.2-6 installed from Chocolatey worked totally fine to measure the size of images. 😢

So I'm still not sure what's going wrong with the invocation on your setup. I can continue to ponder what additional logging we can try to figure out what's different between beets running that convert command and you invoking it manually at the command line.

@Schweinepriester
Copy link
Contributor

ImageMagick 6.9.2-6 installed from Chocolatey

That could be the difference, because I installed it directly from http://imagemagick.org, maybe something gets configured differently - will check tomorrow evening (roughly 20h from now).

Maybe @dprus can comment in the meantime?
=> How did you install ImageMagick?

@Schweinepriester
Copy link
Contributor

Another thought: Powershell vs. cmd?

But of course as you said:

shouldn't be a problem for the way we're executing the command... since we're bypassing the shell's parser and passing the entire path as a unit, we shouldn't need to worry about escaping.

@sampsyo
Copy link
Member

sampsyo commented Nov 24, 2015

Yeah, I agree it probably shouldn't matter—but for whatever it's worth, I was using PowerShell.

I've pushed one last shot. This time, the machinery should print the actual output from ImageMagick in the debug log. Maybe that will offer a clue!

@Schweinepriester
Copy link
Contributor

Here we go :)

PS E:\Desktop\beets-master> python .\beet -vv import […]
[…]
Sending event: database_change
fetchart: using well-named art file cover.jpg
artresizer: method is (2, (6, 9, 2))
ImageMagick size query failed
`convert` exited with (status 1) when getting size with command ['identify', '-format', '%w %h', u'\\\\?\\c:\\users\\kai
\\appdata\\local\\temp\\tmpucklay\\Rotor - Funf (2015)\\cover.jpg']:
identify.exe: unable to open image `\users\kai\appdata\local\temp\tmpucklay\Rotor - Funf (2015)\cover.jpg': No such file
 or directory @ error/blob.c/OpenBlob/2701.
identify.exe: unable to open module file `C:\Program Files\ImageMagick-6.9.2-Q16\modules\coders\IM_MOD_RL_\\?\C_.dll': N
o such file or directory @ warning/module.c/GetMagickModulePath/674.
identify.exe: no decode delegate for this image format `\\?\C' @ error/constitute.c/ReadImage/501.
fetchart: image size: None
fetchart: Could not get size of image (please see documentation for dependencies). The configuration options `minwidth`
and `enforce_ratio` may be violated.
fetchart: found local image c:\users\kai\appdata\local\temp\tmpucklay\Rotor - Funf (2015)\cover.jpg
fetchart: trying source coverart for album RotoR - Fünf
fetchart: downloading image: http://coverartarchive.org/release/4f259ba0-7ae2-479d-bb10-b910e504cd76/front
fetchart: not a supported image: text/html
fetchart: downloading image: http://coverartarchive.org/release-group/107634bf-0713-4190-9670-22bcf5f5df21/front
fetchart: not a supported image: text/html
fetchart: trying source amazon for album RotoR - Fünf
fetchart: trying source albumart for album RotoR - Fünf
fetchart: trying source google for album RotoR - Fünf
fetchart: getting URL: https://ajax.googleapis.com/ajax/services/search/images?q=RotoR%2CF%C3%BCnf&start=0&v=1.0
fetchart: downloading image: http://morefuzz.net/wp-content/uploads/2015/10/Rotor-funf.jpg
fetchart: downloaded art to: c:\users\kai\appdata\local\temp\tmpllbvso.jpg
ImageMagick size query failed
`convert` exited with (status 1) when getting size with command ['identify', '-format', '%w %h', u'\\\\?\\c:\\users\\kai
\\appdata\\local\\temp\\tmpllbvso.jpg']:
identify.exe: unable to open image `\users\kai\appdata\local\temp\tmpllbvso.jpg': No such file or directory @ error/blob
.c/OpenBlob/2701.
identify.exe: unable to open module file `C:\Program Files\ImageMagick-6.9.2-Q16\modules\coders\IM_MOD_RL_\\?\C_.dll': N
o such file or directory @ warning/module.c/GetMagickModulePath/674.
identify.exe: no decode delegate for this image format `\\?\C' @ error/constitute.c/ReadImage/501.
fetchart: image size: None
fetchart: Could not get size of image (please see documentation for dependencies). The configuration options `minwidth`
and `enforce_ratio` may be violated.
fetchart: using remote image c:\users\kai\appdata\local\temp\tmpllbvso.jpg
fetchart: error scraping art page
lyrics: failed to fetch: http://lyrics.wikia.com/Rotor:Scheusal (404)
[…]

That path ``C:\Program Files\ImageMagick-6.9.2-Q16\modules\coders\IM_MOD_RL_\?\C_.dll'is kinda strange, isnt it? As if the\?\C` slipped to the wrong position?

Just in case it could help:
PS C:\Program Files\ImageMagick-6.9.2-Q16\modules\coders> ls => http://pastebin.com/einv5J4k

(Right now sadly no time to test with IM from Chocolatey, but will do that soon if needed)

@sampsyo
Copy link
Member

sampsyo commented Nov 24, 2015

Thanks again! On further inspection, I'm guessing that crazy DLL path is actually a red herring. If I give it a path in that format that actually exists:

> identify -format '%w %h' '\\?\C:\Users\me\realfile.jpg'

I get a size just fine. But if I just make the path point to a file that doesn't exist:

> identify -format '%w %h' '\\?\C:\Users\me\realfilex.jpg'

it says:

identify.exe: unable to open image `\Users\[snip]': No such file or directory @ error/blob.c/OpenBlob/2701.
identify.exe: unable to open module file `C:\Program Files\ImageMagick-6.9.2-Q16\modules\coders\IM_MOD_RL_\\?\C_.dll': No such file or directory @ warning/module.c/GetMagickModulePath/674.
identify.exe: no decode delegate for this image format `\\?\C' @ error/constitute.c/ReadImage/501.

just like your output!

So I think that's the problem: the file actually doesn't exist. But now I'm stumped again, because the fetchart logs seem to show the file being successfully downloaded. Maybe some Windows service is being overzealous about deleting files in that temporary directory?

@Schweinepriester
Copy link
Contributor

Had to look up red herring :D

Well, i guess what you are observing is correct behavior, but I checked if c:\users\kai\appdata\local\temp\tmpwqdpb9\Rotor - Funf (2015)\cover.jpg existed when i tested, and it did.

But now I recorded a GIF which shows two errors

ps_identify

  • Old one: Missing " or ' are a problem; PS seems to wait for a parameter if theres a -
  • New one, which we didnt encounter before i think, the \\?\-path doesnt seem to work when we are on another drive -.-

After recording the GIF I checked additionally the first issue with just a space (renamed the file first of course):

PS E:\Desktop> identify -format '%w %h' \\?\E:\Desktop\IMG_9817 Kopie.jpg
identify.exe: unable to open image `\Desktop\IMG_9817': No such file or directory @ error/blob.c/OpenBlob/2701.
identify.exe: unable to open module file `C:\Program Files\ImageMagick-6.9.2-Q16\modules\coders\IM_MOD_RL_\\?\E_.dll': N
o such file or directory @ warning/module.c/GetMagickModulePath/674.
identify.exe: no decode delegate for this image format `\\?\E' @ error/constitute.c/ReadImage/501.
identify.exe: unable to open image `Kopie.jpg': No such file or directory @ error/blob.c/OpenBlob/2701.

I still hope/think the first issue can be fixed by surrounding the path with ' or ", at least on windows :)

Will try now to find a solution for the second one and what happens with IM from Chocolatey :)

Maybe I should just use beets inside Cygwin, to avoid those crazy windows-paths :D

@Schweinepriester
Copy link
Contributor

PS C:\> identify -format '%w %h' \\.\E:\Desktop\IMG_9817.jpg
3000 2000
PS C:\> cd E:\Desktop
PS E:\Desktop> identify -format '%w %h' \\.\E:\Desktop\IMG_9817.jpg
3000 2000

Does work :)

From: https://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx => https://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath (and some trial and error :P)

But it doesnt work with ' or ":

PS E:\Desktop> identify -format '%w %h' '\\.\E:\Desktop\IMG_9817 Kopie.jpg'
identify.exe: unable to open image `\Desktop\IMG_9817 Kopie.jpg': No such file or directory @ error/blob.c/OpenBlob/2701.
identify.exe: unable to open module file `C:\Program Files\ImageMagick-6.9.2-Q16\modules\coders\IM_MOD_RL_\\.\E_.dll': N
o such file or directory @ warning/module.c/GetMagickModulePath/674.
identify.exe: no decode delegate for this image format `\\.\E' @ error/constitute.c/ReadImage/501.

PS E:\Desktop> identify -format '%w %h' "\\.\E:\Desktop\IMG_9817 Kopie.jpg"
identify.exe: unable to open image `\Desktop\IMG_9817 Kopie.jpg': No such file or directory @ error/blob.c/OpenBlob/2701.
identify.exe: unable to open module file `C:\Program Files\ImageMagick-6.9.2-Q16\modules\coders\IM_MOD_RL_\\.\E_.dll': N
o such file or directory @ warning/module.c/GetMagickModulePath/674.
identify.exe: no decode delegate for this image format `\\.\E' @ error/constitute.c/ReadImage/501.

PS E:\Desktop> identify -format '%w %h' \\.\"E:\Desktop\IMG_9817 Kopie.jpg"
identify.exe: unable to open image `\Desktop\IMG_9817 Kopie.jpg': No such file or directory @ error/blob.c/OpenBlob/2701.
identify.exe: unable to open module file `C:\Program Files\ImageMagick-6.9.2-Q16\modules\coders\IM_MOD_RL_\\.\E_.dll': N
o such file or directory @ warning/module.c/GetMagickModulePath/674.
identify.exe: no decode delegate for this image format `\\.\E' @ error/constitute.c/ReadImage/501.

But maybe that doesn't matter for the context of beets?
Or: On Windows, remove all spaces from the tmp-path and use \\.\?

@Schweinepriester
Copy link
Contributor

To complete my wall of text with logs from IM from choco:

PS E:\Desktop\beets-master> python .\beet -vv import […]
[…]
Sending event: database_change
fetchart: using well-named art file cover.jpg
artresizer: method is (2, (6, 9, 2))
ImageMagick size query failed
`convert` exited with (status 1) when getting size with command ['identify', '-format', '%w %h', u'\\\\?\\c:\\users\\kai
\\appdata\\local\\temp\\tmpd4a68o\\Rotor - Funf (2015)\\cover.jpg']:
identify.exe: unable to open image `\users\kai\appdata\local\temp\tmpd4a68o\Rotor - Funf (2015)\cover.jpg': No such file
 or directory @ error/blob.c/OpenBlob/2701.
identify.exe: unable to open module file `C:\Program Files\ImageMagick-6.9.2-Q16\modules\coders\IM_MOD_RL_\\?\C_.dll': N
o such file or directory @ warning/module.c/GetMagickModulePath/674.
identify.exe: no decode delegate for this image format `\\?\C' @ error/constitute.c/ReadImage/501.
fetchart: image size: None
fetchart: Could not get size of image (please see documentation for dependencies). The configuration options `minwidth`
and `enforce_ratio` may be violated.
fetchart: found local image c:\users\kai\appdata\local\temp\tmpd4a68o\Rotor - Funf (2015)\cover.jpg
fetchart: trying source coverart for album RotoR - Fünf
fetchart: downloading image: http://coverartarchive.org/release/4f259ba0-7ae2-479d-bb10-b910e504cd76/front
fetchart: not a supported image: text/html
fetchart: downloading image: http://coverartarchive.org/release-group/107634bf-0713-4190-9670-22bcf5f5df21/front
fetchart: not a supported image: text/html
fetchart: trying source amazon for album RotoR - Fünf
fetchart: trying source albumart for album RotoR - Fünf
fetchart: trying source google for album RotoR - Fünf
fetchart: getting URL: https://ajax.googleapis.com/ajax/services/search/images?q=RotoR%2CF%C3%BCnf&start=0&v=1.0
fetchart: downloading image: http://morefuzz.net/wp-content/uploads/2015/10/Rotor-funf.jpg
fetchart: downloaded art to: c:\users\kai\appdata\local\temp\tmpbgt1g1.jpg
ImageMagick size query failed
`convert` exited with (status 1) when getting size with command ['identify', '-format', '%w %h', u'\\\\?\\c:\\users\\kai
\\appdata\\local\\temp\\tmpbgt1g1.jpg']:
identify.exe: unable to open image `\users\kai\appdata\local\temp\tmpbgt1g1.jpg': No such file or directory @ error/blob
.c/OpenBlob/2701.
identify.exe: unable to open module file `C:\Program Files\ImageMagick-6.9.2-Q16\modules\coders\IM_MOD_RL_\\?\C_.dll': N
o such file or directory @ warning/module.c/GetMagickModulePath/674.
identify.exe: no decode delegate for this image format `\\?\C' @ error/constitute.c/ReadImage/501.
fetchart: image size: None
fetchart: Could not get size of image (please see documentation for dependencies). The configuration options `minwidth`
and `enforce_ratio` may be violated.
fetchart: using remote image c:\users\kai\appdata\local\temp\tmpbgt1g1.jpg
fetchart: error scraping art page
lyrics: failed to fetch: http://lyrics.wikia.com/Rotor:Scheusal (404)

and on the same drive (C:)

PS C:\temp_kai\beets-master> python .\beet -vv import […]
[…]
Sending event: database_change
fetchart: using well-named art file cover.jpg
artresizer: method is (2, (6, 9, 2))
fetchart: image size: (1477, 1429)
fetchart: image is not square (1477 != 1429)
fetchart: trying source coverart for album RotoR - Fünf
fetchart: downloading image: http://coverartarchive.org/release/4f259ba0-7ae2-479d-bb10-b910e504cd76/front
fetchart: not a supported image: text/html
fetchart: downloading image: http://coverartarchive.org/release-group/107634bf-0713-4190-9670-22bcf5f5df21/front
fetchart: not a supported image: text/html
fetchart: trying source amazon for album RotoR - Fünf
fetchart: trying source albumart for album RotoR - Fünf
fetchart: trying source google for album RotoR - Fünf
fetchart: getting URL: https://ajax.googleapis.com/ajax/services/search/images?q=RotoR%2CF%C3%BCnf&start=0&v=1.0
fetchart: downloading image: http://morefuzz.net/wp-content/uploads/2015/10/Rotor-funf.jpg
fetchart: downloaded art to: c:\users\kai\appdata\local\temp\tmpd6xiql.jpg
fetchart: image size: (1477, 1429)
fetchart: image is not square (1477 != 1429)
fetchart: downloading image: http://www.metalunderground.at/wp-content/uploads/2015/09/Rotor_-_F%C3%BCnf.jpg
fetchart: downloaded art to: c:\users\kai\appdata\local\temp\tmpkkv3mn.jpg
fetchart: image size: (340, 340)
fetchart: image too small (340 < 750)
fetchart: downloading image: https://www.flight13.com/bilder/116166.jpg
fetchart: downloaded art to: c:\users\kai\appdata\local\temp\tmppzovxh.jpg
fetchart: image size: (600, 600)
fetchart: image too small (600 < 750)
fetchart: downloading image: https://media2.jpc.de/image/w600/front/0/4051579004827.jpg
fetchart: downloaded art to: c:\users\kai\appdata\local\temp\tmpdltb_8.jpg
fetchart: image size: (600, 536)
fetchart: image too small (600 < 750)
lyrics: failed to fetch: http://lyrics.wikia.com/Rotor:Scheusal (404)

TL;DR

So there we have it, a \\.\-path without spaces on Windows would be the solution to escape the current drive :)

@sampsyo
Copy link
Member

sampsyo commented Nov 28, 2015

Wow! Thanks for all this extra investigation. It's truly strange that the problem indeed seems to be crossing filesystem boundaries—I'll need to do some more reading to understand what's going on. Especially puzzling is this bit from the MSDN docs:

Most APIs won't support "."; only those that are designed to work with the device namespace will recognize it. Always check the reference topic for each API to be sure.

So that prefix is special-purpose for device-related APIs. It doesn't intuitively sound like something ImageMagick would support, but apparently it does! Mysterious!

@sampsyo
Copy link
Member

sampsyo commented Nov 30, 2015

OK, I've pushed a (temporary? possible?) fix by just disabling that Windows ?\ prefix for ImageMagick calls. The hypothesis is that IM just gets confused by them. Can you check whether this makes things work on your system?

The cost, of course, is that we may lose support for long paths. I'm crossing my fingers, though, that IM has built-in, special support for long paths and we just don't need the prefix when dealing with it.

@Schweinepriester
Copy link
Contributor

Sorry for the late response, had to write my thesis :P

Just checked with the new shiny 1.3.16, seems to be working:

PS E:\Desktop> beet -vv import …
…
Sending event: database_change
fetchart: trying source coverart for album Bloodhound Gang - Hard-Off
artresizer: method is (1, (0,))
fetchart: downloading image: http://coverartarchive.org/release/3ae3e74d-7019-463b-bca4-2df0f81141c5/front
fetchart: downloaded art to: c:\users\kai\appdata\local\temp\tmpzd8y_p.jpg
fetchart: image size: (360, 360)
fetchart: image too small (360 < 750)
fetchart: downloading image: http://coverartarchive.org/release-group/a22452ea-9cf3-4407-867c-64bc43428c5c/front
fetchart: downloaded art to: c:\users\kai\appdata\local\temp\tmppgj0pn.jpg
fetchart: image size: (360, 360)
fetchart: image too small (360 < 750)
fetchart: trying source amazon for album Bloodhound Gang - Hard-Off
fetchart: trying source albumart for album Bloodhound Gang - Hard-Off
Sending event: item_copied

Lets assume it works, will monitor in the future with long path etc. :)

@sampsyo
Copy link
Member

sampsyo commented Dec 29, 2015

Woohoo!

@duckpuppy
Copy link

@sampsyo

Actually, the quoting thing shouldn't be a problem for the way we're executing the command... since
we're bypassing the shell's parser and passing the entire path as a unit, we shouldn't need to worry
about escaping.

I found this while searching for my own error (which I will be filing separately), but on Cygwin Python at least you need to escape. I have been struggling with the acoustid plugin on Cygwin, and the first error I got was a "file not found" error trying to run ffmpeg. Making sure that the filename is in quotes in the args array passed into popen made that go away. I still have another problem, but Cygwin Python has some quirks (like trying to kill a process, the pid has to be obtained a different way).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."
Projects
None yet
Development

No branches or pull requests

4 participants