imagetools.php
author Dan
Fri, 15 Aug 2008 23:59:15 -0400
changeset 35 8040903d25de
parent 25 5c377ceb0e4c
child 40 bd3372a2afc1
permissions -rw-r--r--
Updated readme for imminent release 0.1a3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
     1
<?php
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
     2
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
     3
/**
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
     4
 * Greyhound - real web management for Amarok
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
     5
 * Copyright (C) 2008 Dan Fuhry
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
     6
 *
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
     7
 * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
     8
 * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
     9
 *
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    10
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    11
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    12
 */
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    13
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    14
/**
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    15
 * Determines an image's filetype based on its signature.
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    16
 * @param string Path to image file
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    17
 * @return string One of gif, png, or jpg, or false if none of these.
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    18
 */
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    19
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    20
function get_image_filetype($filename)
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    21
{
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    22
  $filecontents = @file_get_contents($filename);
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    23
  if ( empty($filecontents) )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    24
    return false;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    25
  
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    26
  if ( substr($filecontents, 0, 8) == "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a" )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    27
    return 'png';
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    28
  
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    29
  if ( substr($filecontents, 0, 6) == 'GIF87a' || substr($filecontents, 0, 6) == 'GIF89a' )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    30
    return 'gif';
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    31
  
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    32
  if ( substr($filecontents, 0, 2) == "\xFF\xD8" )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    33
    return 'jpg';
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    34
  
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    35
  return false;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    36
}
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    37
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    38
/**
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    39
 * Scales an image to the specified width and height, and writes the output to the specified
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    40
 * file. Will use ImageMagick if present, but if not will attempt to scale with GD. This will
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    41
 * always scale images proportionally.
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    42
 * 
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    43
 * Ported from Enano CMS (which is also my project)
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    44
 * 
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    45
 * @param string Path to image file
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    46
 * @param string Path to output file
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    47
 * @param int Image width, in pixels
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    48
 * @param int Image height, in pixels
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    49
 * @param bool If true, the output file will be deleted if it exists before it is written
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    50
 * @return bool True on success, false on failure
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    51
 */
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    52
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    53
function scale_image($in_file, $out_file, $width = 225, $height = 225, $unlink = false)
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    54
{
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    55
  global $db, $session, $paths, $template, $plugins; // Common objects
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    56
  
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    57
  if ( !is_int($width) || !is_int($height) )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    58
    return false;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    59
  
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    60
  if ( !file_exists($in_file) )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    61
    return false;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    62
  
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    63
  if ( preg_match('/["\'\/\\]/', $in_file) || preg_match('/["\'\/\\]/', $out_file) )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    64
    return false;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    65
  
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    66
  if ( file_exists($out_file) && !$unlink )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    67
    return false;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    68
  else if ( file_exists($out_file) && $unlink )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    69
    @unlink($out_file);
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    70
  if ( file_exists($out_file) )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    71
    // couldn't unlink (delete) the output file
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    72
    return false;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    73
    
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    74
  $file_ext = substr($in_file, ( strrpos($in_file, '.') + 1));
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    75
  switch($file_ext)
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    76
  {
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    77
    case 'png':
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    78
      $func = 'imagecreatefrompng';
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    79
      break;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    80
    case 'jpg':
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    81
    case 'jpeg':
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    82
      $func = 'imagecreatefromjpeg';
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    83
      break;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    84
    case 'gif':
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    85
      $func = 'imagecreatefromgif';
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    86
      break;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    87
    case 'xpm':
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    88
      $func = 'imagecreatefromxpm';
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    89
      break;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    90
    default:
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    91
      return false;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    92
  }
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    93
    
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    94
  // try to find convert in the PATH
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    95
  // FIXME: unix specific (won't work on windows)
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    96
  $path = ( isset($_ENV['PATH']) ) ? $_ENV['PATH'] : ( isset($_SERVER['PATH']) ? $_SERVER['PATH'] : '/usr/local/bin:/usr/bin:/bin' );
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    97
  $path = explode(':', $path);
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    98
  foreach ( $path as $dir )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
    99
  {
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   100
    if ( file_exists("$dir/convert") && is_executable("$dir/convert") )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   101
    {
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   102
      $magick_path = "$dir/convert";
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   103
    }
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   104
  }
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   105
  
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   106
  $can_use_magick = isset($magick_path);
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   107
  $can_use_gd = (
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   108
      function_exists('getimagesize')         &&
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   109
      function_exists('imagecreatetruecolor') &&
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   110
      function_exists('imagecopyresampled')   &&
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   111
      function_exists($func)
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   112
    );
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   113
  if ( $can_use_magick )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   114
  {
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   115
    if ( !preg_match('/^([\/A-z0-9_-]+)$/', $magick_path) )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   116
    {
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   117
      // ImageMagick path seems screwy
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   118
      return false;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   119
    }
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   120
    $cmdline = "\"$magick_path\" \"$in_file\" -resize \"{$width}x{$height}>\" \"$out_file\"";
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   121
    system($cmdline, $return);
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   122
    if ( !file_exists($out_file) )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   123
      return false;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   124
    return true;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   125
  }
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   126
  else if ( $can_use_gd )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   127
  {
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   128
    @list($width_orig, $height_orig) = @getimagesize($in_file);
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   129
    if ( !$width_orig || !$height_orig )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   130
      return false;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   131
    // calculate new width and height
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   132
    
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   133
    $ratio = $width_orig / $height_orig;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   134
    if ( $ratio > 1 )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   135
    {
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   136
      // orig. width is greater that height
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   137
      $new_width = $width;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   138
      $new_height = round( $width / $ratio );
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   139
    }
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   140
    else if ( $ratio < 1 )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   141
    {
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   142
      // orig. height is greater than width
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   143
      $new_width = round( $height / $ratio );
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   144
      $new_height = $height;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   145
    }
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   146
    else if ( $ratio == 1 )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   147
    {
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   148
      $new_width = $width;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   149
      $new_height = $width;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   150
    }
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   151
    if ( $new_width > $width_orig || $new_height > $height_orig )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   152
    {
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   153
      // Too big for our britches here; set it to only convert the file
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   154
      $new_width = $width_orig;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   155
      $new_height = $height_orig;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   156
    }
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   157
    
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   158
    $newimage = @imagecreatetruecolor($new_width, $new_height);
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   159
    if ( !$newimage )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   160
      return false;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   161
    $oldimage = @$func($in_file);
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   162
    if ( !$oldimage )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   163
      return false;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   164
    
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   165
    // Perform scaling
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   166
    imagecopyresampled($newimage, $oldimage, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   167
    
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   168
    // Get output format
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   169
    $out_ext = substr($out_file, ( strrpos($out_file, '.') + 1));
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   170
    switch($out_ext)
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   171
    {
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   172
      case 'png':
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   173
        $outfunc = 'imagepng';
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   174
        break;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   175
      case 'jpg':
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   176
      case 'jpeg':
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   177
        $outfunc = 'imagejpeg';
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   178
        break;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   179
      case 'gif':
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   180
        $outfunc = 'imagegif';
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   181
        break;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   182
      case 'xpm':
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   183
        $outfunc = 'imagexpm';
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   184
        break;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   185
      default:
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   186
        imagedestroy($newimage);
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   187
        imagedestroy($oldimage);
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   188
        return false;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   189
    }
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   190
    
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   191
    // Write output
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   192
    $outfunc($newimage, $out_file);
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   193
    
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   194
    // clean up
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   195
    imagedestroy($newimage);
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   196
    imagedestroy($oldimage);
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   197
    
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   198
    // done!
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   199
    return true;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   200
  }
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   201
  if ( file_exists($out_file) )
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   202
    return true;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   203
  return false;
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   204
}
5c377ceb0e4c Added initial album artwork support.
Dan
parents:
diff changeset
   205