getimagesize() error on viewing podcast xml feed

drewz - July 5, 2006 - 04:44
Project:Playlist (toolkit, modules)
Version:HEAD
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

* warning: getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration in /home/.carmen/tapestry/tapestry/modules/playlist/audio_playlist/audio_playlist.module on line 629.
* warning: getimagesize(http://tapestry.the-janes.com/podcast.gif) [function.getimagesize]: failed to open stream: no suitable wrapper could be found in /home/.carmen/tapestry/tapestry/modules/playlist/audio_playlist/audio_playlist.module on line 629.

For my hosting company's server config, URL file-access is disabled, so entering a absolute url to an image under the same website doesn't work. Using a relative URL fixes this error, but then the image url generated in the podcast xml is incorrect.

Fix could be for relative image URL's, prepend the server url when generating the podcast feed (line 629):

  $abs_image_url = $playlist->playlist_info['image_url'];
  if($abs_image_url && strpos($abs_image_url, "://") == 0) {
$abs_image_url = $base_url."/".$playlist->playlist_info['image_url'];
  }
 
  $output .= "<itunes:image href=\"{$abs_image_url}\" />";
  list($img_width, $img_height, $img_type, $img_attr) = getimagesize($playlist->playlist_info['image_url']);
  $output .= "<image><url>{$abs_image_url}</url><width>{$img_width}</width><height>{$img_height}</height></image>";

Excuse my ugly code. I'm a java coder by trade :) I'm sure there's a better solution using some php magic I just don't know about...

#1

zirafa - July 5, 2006 - 07:10

Interesting problem. The only problem with using relative paths is that it breaks the feed for podcasts and the like. Most likely we could fix this simply in theme_audio_playlist_body() though so that on a node view it will make sure the link is relative.

The real solution, however, is to have the ability to actually upload images directly to your server instead of linking to an external URL. This could be a regular file upload, an image file upload, or integration with the image_attach.module.

 
 

Drupal is a registered trademark of Dries Buytaert.