Commit graph

167 commits

Author SHA1 Message Date
Adrian Sampson
07d3f3e066 lazily initialize ArtResizer singleton (#64)
Searching for `convert` or PIL has non-negligible performance overhead, so it's
preferable to only do it when really necessary. This way, the search is only
performed when ArtResizer.shared is accessed for the first time.
2012-11-01 11:40:53 -07:00
Adrian Sampson
3873c29448 artresizer (#64): helper functions, not classes
The previous method was to change self.__class__ dynamically to make __init__
instantiate different classes. This new way, which uses bare functions instead
of separate functor-like classes, instead just forwards the resize() call to
a module-global implementation based on self.method.

Additionally, the semantics of ArtResizer have changed. Clients now *always*
call resize() and proxy_url(), regardless of method. The method makes *one* of
these a no-op. This way, clients need not manually inspect which method is
being used.
2012-10-31 23:33:59 -07:00
Fabrice Laporte
7f2aa44ac6 Add 'maxwidth' option to embedart and fetchart plugins.
artresizer.py instances an ArtResizer object that uses internally the PIL; ImageMagick
or a web proxy service to perform the resizing operations.
Because embedart works on input images located on filesystem it requires PIL or ImageMagick, whereas
fetchart is able to do the job with the fallback webproxy resizer.
2012-10-28 15:36:42 +01:00
Adrian Sampson
66e75c398d embedart: log & skip unreadable audio files 2012-05-21 10:47:17 -07:00
Adrian Sampson
f6b37d2c8c remove with_statement __future__ imports
This is the first of several commits that will modernize the beets codebase for
Python 2.6 conventions. (Compatibility with Python 2.5 is hereby abandoned.)
2012-05-13 20:39:07 -07:00
Adrian Sampson
a1b2b6c8a2 fix plugin hook in embedart 2011-12-28 15:56:07 -08:00
Adrian Sampson
3b2ea5d289 add a missing __future__ import in embedart 2011-07-10 12:07:52 -07:00
Adrian Sampson
fed8782ca1 fix Unicode queries from CLI arguments 2011-07-01 15:43:06 -07:00
Adrian Sampson
fcc2744ac5 use separate shell arguments for queries to preserve whitespace 2011-06-26 00:12:45 -07:00
Adrian Sampson
8341dee3ab reorder items() and albums() parameters to reflect common use 2011-05-05 17:20:24 -07:00
Adrian Sampson
a0e7c70c64 "clearart" command for removing embedded album art 2011-04-27 10:37:46 -07:00
Adrian Sampson
73c4bedc41 simplify MediaFile art interface: no type is included
The interface no longer specifies the type of the image embedded in the file; it
just returns a bytestring blob. When a type must be stored, it is inferred using
the imghdr module, which shoudl reduce the potential for weird bugs when the
formats don't correspond.
2011-04-27 10:27:26 -07:00
Adrian Sampson
2768e71c21 config option for disabling automatic embedding 2011-04-21 01:42:08 -07:00
Adrian Sampson
e8d54af9df NEWS note; check for missing art when extracting 2011-04-21 01:33:56 -07:00
Adrian Sampson
415fe0be31 "embedart" and "extractart" commands 2011-04-21 01:20:50 -07:00
Adrian Sampson
866c662014 use imghdr directly instead of MIME lib (which uses imghdr) 2011-04-21 00:42:16 -07:00
Adrian Sampson
c20ce11a8c update album art embed plugin for new API
--HG--
rename : beetsplug/embedcoverart.py => beetsplug/embedart.py
2011-04-21 00:01:34 -07:00