--- /dev/null
+<?php\r
+ /**\r
+ * Tidypics Thumbnail Creation Test\r
+ *\r
+ * Called through ajax\r
+ */\r
+ \r
+ include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/engine/start.php";\r
+ include dirname(dirname(__FILE__)) . "/lib/resize.php";\r
+ \r
+ global $CONFIG;\r
+ \r
+ $guid = $_GET['guid'];\r
+\r
+ $image = get_entity($guid);\r
+ if (!$image || !($image instanceof TidypicsImage)) {\r
+ echo "Unable to get original image";\r
+ return; \r
+ }\r
+ \r
+ $filename = $image->getFilename();\r
+ $container_guid = $image->container_guid;\r
+ if (!$filename || !$container_guid) {\r
+ echo "Error retrieving information about the image";\r
+ return;\r
+ }\r
+ \r
+ $title = $image->title;\r
+ $prefix = "image/" . $container_guid . "/";\r
+ $filestorename = substr($filename, strlen($prefix));\r
+ \r
+ $image_lib = get_plugin_setting('image_lib', 'tidypics');\r
+ if (!$image_lib)\r
+ $image_lib = "GD";\r
+ \r
+ if ($image_lib == 'ImageMagick') { // ImageMagick command line\r
+ \r
+ if (tp_create_imagick_cmdline_thumbnails($image, $prefix, $filestorename) != true) {\r
+ trigger_error('Tidypics warning: failed to create thumbnails - ImageMagick command line', E_USER_WARNING);\r
+ echo "Failed to create thumbnails";\r
+ }\r
+ \r
+ } else if ($image_lib == 'ImageMagickPHP') { // ImageMagick PHP \r
+ \r
+ if (tp_create_imagick_thumbnails($image, $prefix, $filestorename) != true) {\r
+ trigger_error('Tidypics warning: failed to create thumbnails - ImageMagick PHP', E_USER_WARNING);\r
+ echo "Failed to create thumbnails";\r
+ }\r
+ \r
+ } else { \r
+ \r
+ if (tp_create_gd_thumbnails($image, $prefix, $filestorename) != true) {\r
+ trigger_error('Tidypics warning: failed to create thumbnails - GD', E_USER_WARNING);\r
+ echo "Failed to create thumbnails";\r
+ }\r
+ \r
+ } // end of image library selector\r
+ \r
+ echo "<img id=\"tidypics_image\" src=\"{$CONFIG->wwwroot}mod/tidypics/thumbnail.php?file_guid={$guid}&size=large\" alt=\"{$title}\" />";\r
+ \r
+?>\r
<?php\r
/**\r
- * Tisypics ImageMagick Location Test\r
+ * Tidypics ImageMagick Location Test\r
*\r
* Called through ajax\r
*/\r
continue;\r
}\r
\r
-\r
+ //get and store the exif data\r
+ td_get_exif($file);\r
+ \r
+ \r
+ // resize photos to create thumbnails\r
if ($image_lib == 'ImageMagick') { // ImageMagick command line\r
\r
if (tp_create_imagick_cmdline_thumbnails($file, $prefix, $filestorename) != true) {\r
$file_for_river = $file;\r
}\r
\r
- //get and store the exif data\r
- td_get_exif($file);\r
array_push($uploaded_images, $file->guid);\r
\r
// update user/group size for checking quota\r
\r
------------------------------------------------------------------------\r
Version 1.6.2 Change List\r
-Release Date: \r
+Release Date: 09/03/2009\r
------------------------------------------------------------------------\r
BEGIN VERSION 1.6.2 CHANGES\r
------------------------------------------------------------------------\r
'tidypics:settings' => 'Settings',\r
'tidypics:admin:instructions' => 'These are the core Tidypics settings. Change them for your setup and then click save.',\r
'tidypics:settings:image_lib' => "Image Library",\r
+ 'tidypics:settings:thumbnail' => "Thumbnail Creation",\r
'tidypics:settings:download_link' => "Show download link",\r
'tidypics:settings:tagging' => "Enable photo tagging",\r
'tidypics:settings:photo_ratings' => "Enable photo ratings (requires rate plugin of Miguel Montes or compatible)",\r
'tidypics:settings:largesize' => "Primary image size",\r
'tidypics:settings:smallsize' => "Album view image size",\r
'tidypics:settings:thumbsize' => "Thumbnail image size",\r
-\r
+ 'tidypics:settings:im_id' => "Image ID",\r
+ \r
//actions\r
\r
'album:create' => "Create new album",\r
if (get_plugin_setting('tagging', 'tidypics') != "disabled")\r
$num_tags = count_annotations(0, 'object', 'image', 'phototag');\r
?>\r
-<p>\r
<br />\r
+<h3>Overview</h3>\r
+<p>\r
An image library is required by Tidypics to perform various manipulations: resizing on upload, watermarking, rotation, and cropping.\r
There are three image library options with Tidypics: PHP extension <a href="http://www.php.net/manual/en/book.image.php">GD</a>, \r
<a href="http://www.imagemagick.org/">ImageMagick</a> called via a system call, and the PHP extension \r
<a href="http://pecl.php.net/package/imagick/">imagick</a>. GD is the most common of the three on hosted servers but suffers \r
from serious memory usage problems when resizing photos. If you have access to ImageMagick (whether through system calls or the\r
PHP extension), we recommend that you use that.\r
-</p><p>\r
+</p>\r
<h3>Testing ImageMagick Commandline</h3>\r
+<p>\r
To use the ImageMagick executables, PHP must be configured to allow calls to exec(). You can check our \r
<a href="<?php echo $CONFIG->wwwroot . 'mod/tidypics/pages/server_analysis.php'; ?>">server analysis page</a> to find out the \r
configuration of your server. Next, you need to determine the path to ImageMagick on your server. Your hosting service should \r
be able to provide this to you. You can test if the location is correct below. If successful, it should display the version of \r
ImageMagick installed on your server. \r
</p>\r
-<p>\r
<br />\r
+<p>\r
<?php echo elgg_echo('tidypics:settings:im_path'); ?><br />\r
<input name="im_location" type="text" />\r
<input type="submit" value="Submit" onclick="TestImageMagickLocation();" />\r
--- /dev/null
+<br />\r
+<h3>Overview</h3>\r
+<p>\r
+This page allows you to create thumbnails for images when the thumbnail creation failed during upload. \r
+You may experience problems with thumbnail creation if your image library in not configured properly or\r
+if there is not enough memory for the GD library to load and resize an image. If your users have \r
+experienced problems with thumbnail creation and you have modified your setup, you can try to redo the\r
+thumbnails. Find the unique identifier of the photo (it is the number near the end of the url when viewing\r
+a photo) and enter it below. \r
+</p>\r
+<h3>Thumbnail Creation</h3>\r
+<p>\r
+<b><?php echo elgg_echo('tidypics:settings:im_id'); ?></b>:\r
+<input name="image_id" type="text" />\r
+<input type="submit" value="Submit" onclick="TestThumbnailCreation();" />\r
+</p>\r
+<div id="im_results"></div>\r
+<script type="text/javascript">\r
+function TestThumbnailCreation()\r
+{\r
+ var image_id = $('input[name=image_id]').val();\r
+ $("#im_results").html("");\r
+ $.ajax({\r
+ type: "GET",\r
+ url: "<?php echo $CONFIG->wwwroot . 'mod/tidypics/actions/create_thumbnails.php'; ?>",\r
+ data: {guid: image_id},\r
+ cache: false,\r
+ success: function(html){\r
+ $("#im_results").html(html);\r
+ }\r
+ });\r
+}\r
+</script>
\ No newline at end of file
$settingsselect = '';
$statsselect = '';
$imagelibselect = '';
+ $thumbnailselect = '';
switch($tab) {
case 'settings':
$settingsselect = 'class="selected"';
case 'imagelib':
$imagelibselect = 'class="selected"';
break;
+ case 'thumbnail':
+ $thumbnailselect = 'class="selected"';
+ break;
}
?>
<li <?php echo $settingsselect; ?>><a href="<?php echo $CONFIG->wwwroot . 'mod/tidypics/pages/admin.php?tab=settings'; ?>"><?php echo elgg_echo('tidypics:settings'); ?></a></li>
<li <?php echo $statsselect; ?>><a href="<?php echo $CONFIG->wwwroot . 'mod/tidypics/pages/admin.php?tab=stats'; ?>"><?php echo elgg_echo('tidypics:stats'); ?></a></li>
<li <?php echo $imagelibselect; ?>><a href="<?php echo $CONFIG->wwwroot . 'mod/tidypics/pages/admin.php?tab=imagelib'; ?>"><?php echo elgg_echo('tidypics:settings:image_lib'); ?></a></li>
+ <li <?php echo $thumbnailselect; ?>><a href="<?php echo $CONFIG->wwwroot . 'mod/tidypics/pages/admin.php?tab=thumbnail'; ?>"><?php echo elgg_echo('tidypics:settings:thumbnail'); ?></a></li>
</ul>
</div>
<?php
case 'imagelib':
echo elgg_view("tidypics/admin/imagelib");
break;
+ case 'thumbnail':
+ echo elgg_view("tidypics/admin/thumbnails");
+ break;
}
?>
</div>