Implement image identification buttons using regex.info/exif, google images and tineye

This commit is contained in:
Marcin Łabanowski 2012-12-23 04:38:20 +01:00 committed by Michael Foster
parent b7d884ef45
commit 7c8bbe8527
3 changed files with 29 additions and 0 deletions

View File

@ -485,6 +485,9 @@
$config['show_ratio'] = false;
// Display the file's original filename
$config['show_filename']= true;
// Image identification buttons using regex.info/exif, tineye and google images
$config['image_identification'] = false;
// Redraw the image using GD functions to strip any excess data (commonly ZIP archives)
// WARNING: Currently strips animated GIFs too
@ -753,6 +756,11 @@
$config['root'] = (str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) == '/' ? '/' : str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) . '/');
else
$config['root'] = '/'; // CLI mode
// The scheme and domain. This is needed to get absolute URL of some page (for instance image
// identification buttons). If you use the CLI tools, it would be wise to override this setting.
$config['domain'] = (isset ($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? "https://" : "http://";
$config['domain'] .= isset ($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';
// If for some reason the folders and static HTML index files aren't in the current working direcotry,
// enter the directory path here. Otherwise, keep it false.

View File

@ -71,6 +71,17 @@
<span class="postfilename">{{ post.filename|bidi_cleanup }}</span>
{% endif %}
{% endif %}
{% if post.thumb != 'file' and config.image_identification %}
,
<span class='image_id'>
{% if post.file|extension == 'jpg' %}
<a href="http://regex.info/exif.cgi?url={{ config.domain }}{{ config.uri_img }}{{ post.file }}">e</a>
{% endif %}
<a href="http://www.google.com/searchbyimage?image_url={{ config.domain }}{{ config.uri_img }}{{ post.file }}">g</a>
<a href="http://www.tineye.com/search?url={{ config.domain }}{{ config.uri_img }}{{ post.file }}">t</a>
</span>
{% endif %}
)
</span>
</p>

View File

@ -28,6 +28,16 @@
<span class="postfilename">{{ post.filename|bidi_cleanup }}</span>
{% endif %}
{% endif %}
{% if post.thumb != 'file' and config.image_identification %}
,
<span class='image_id'>
{% if post.file|extension == 'jpg' %}
<a href="http://regex.info/exif.cgi?url={{ config.domain }}{{ config.uri_img }}{{ post.file }}">e</a>
{% endif %}
<a href="http://www.google.com/searchbyimage?image_url={{ config.domain }}{{ config.uri_img }}{{ post.file }}">g</a>
<a href="http://www.tineye.com/search?url={{ config.domain }}{{ config.uri_img }}{{ post.file }}">t</a>
</span>
{% endif %}
)
</span></p>
<a href="{{ config.uri_img }}{{ post.file }}" target="_blank"{% if post.thumb == 'file' %} class="file"{% endif %}>