#48 Modify getpictures.pl to cache/return large images


Amazon stores cover art images that are as large as
500x500 (maybe larger); so why not cache that one and
resize before storing in the /cover_art/ directory?

I'm attaching both a patch for createalbums.pl and the
actual file that I'm using right now.

I made the modifications for both GD and Imagemagick,
but I only use Imagemagick and haven't tested the GD
part. If someone could help out, I'd appreciate it.

I've moved some of the code in extract_image into their
own functions to clean it up a bit.

What this does:

** createimages.pl will not grab what it finds at
Amazon, Google, or IMDB. It will cache THAT IMAGE
unless it was rejected due to being too small (set
variables in script to your liking) or too rectangular.
I'm using 200x200 as my "opimum" cover art size -- you
may need to change this to 170x170 if that is what you
prefer (GJukebox default).

** it will return BOTH a resized image *and* the large
image it finds to the cover_art directory. One image
is called BGFZ00005.jpg (whatever Amazon returns) and
the large one is called rAw_BGFZ00005.jpg.

** Future development, not done yet: When the user
clicks on the album, in the detail view he or she will
get the large, detailed cover image. This will be as
simple as appending a "rAw_" to the beginning of the
cover art filename that is stored in the DB.

Please check it out and see if you like it. You'll see
the large and small images in the "cover art admin"
area. Attaching a screenshot also to illustrate.


  • William Skellenger

    Logged In: YES

    With this attachment (the actual script) please take care
    that you return the optimum image sizing to 170 if that is
    what you prefer.

  • William Skellenger

    Screenshot of large covers that were grabbed

  • William Skellenger

    Logged In: YES

    Had a bug handling already-cached images. Fixed and tested.
    Attaching updated patch and deleting the old one.

  • William Skellenger

    Logged In: YES

    One more fix concerning divide by zero.

  • William Skellenger

    Already-patched getpictures.pl


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks