comparison scald_dailymotion.module @ 9:1907129beb95 tip

Thumbnails: Create the thumbnail directory if it doesn't exist yet
author Franck Deroche <franck@defr.org>
date Mon, 13 Sep 2010 14:28:05 +0200
parents da69ba21d0c3
children
comparison
equal deleted inserted replaced
8:da69ba21d0c3 9:1907129beb95
131 } 131 }
132 // Download a copy of the video thumbnail. This makes it possible 132 // Download a copy of the video thumbnail. This makes it possible
133 // to do interesting things when used with ImageCache for example. 133 // to do interesting things when used with ImageCache for example.
134 $thumb = drupal_http_request($infos->thumbnail['src']); 134 $thumb = drupal_http_request($infos->thumbnail['src']);
135 $dir = file_directory_path() . '/dailymotion'; 135 $dir = file_directory_path() . '/dailymotion';
136 if ($thumb->code == 200 && file_check_directory($dir)) { 136 if ($thumb->code == 200 && file_check_directory($dir, FILE_CREATE_DIRECTORY)) {
137 $dest = $dir . '/' . $infos->id . '.jpg'; 137 $dest = $dir . '/' . $infos->id . '.jpg';
138 $file = file_save_data($thumb->data, $dest); 138 $file = file_save_data($thumb->data, $dest);
139 } 139 }
140 // Create an atom 140 // Create an atom
141 $atom = new stdClass; 141 $atom = new stdClass;