Posted by joe cocker Fri 23rd Mar 2007 20:59 - Syntax is PHP - 54 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers
PHP parser reported no syntax errors in this post!
-
-
-
-
require_once('magic.php');
-
require_once('copy_install.php');
-
require_once('get.php');
-
require_once('identify.php');
-
require_once('isimage.php');
-
-
import('random/char', 'database/insert', 'gallery/add_image', 'file/unlink');
-
-
function image_install($image, $gallery_id, $type = 'original', $original = 0, $ext = 'jpg')
-
{
-
$title = $image;
-
-
if (!image_isimage($image)) {
-
return false;
-
}
-
-
-
/** lige nu kører den IKKE originalen igennem image magick! **/
-
-
-
$folder = PATH_IMAGES . $f0 . '/';
-
}
-
$folder .= $f1 . '/';
-
}
-
-
/** check if image file exists already */
-
$path = $folder . $checksum . '.' . $ext;
-
if (!$file_existed) {
-
}
-
-
-
/** get dimensions */
-
$info = image_identify($path);
-
$width = $info['width'];
-
$height = $info['height'];
-
-
-
$is_original = ($type == 'original');
-
if ($is_original)
-
{
-
/** prepare database data */
-
$table = 'images_originals';
-
'path' => $path,
-
'checksum' => $checksum,
-
);
-
-
/** insert data */
-
$image_id = database_insert($table, $image_values);
-
-
/** add to gallery */
-
gallery_add_image($gallery_id, $image_id);
-
-
/** create copies */
-
$image = image_get($image_id, 'original');
-
image_copy_install($image, $file_existed, 'standard', 'thumb', 'mini');
-
}
-
else
-
{
-
$table = 'images_copies';
-
'path' => $path,
-
'checksum' => $checksum,
-
'type' => $type
-
);
-
$image_id = database_insert($table, $image_values);
-
}
-
-
return $image_id;
-
}
-
-
?>
-
PermaLink to this entry https://pastebin.co.uk/12150
Posted by joe cocker Fri 23rd Mar 2007 20:59 - Syntax is PHP - 54 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers
Comments: 0