Skip to content

Commit

Permalink
feature 2604 multisize rotation - fix creation of derivatives for rep…
Browse files Browse the repository at this point in the history
…resentatives of non image elements + avoid unnecessary sql update query

git-svn-id: http://piwigo.org/svn/trunk@13864 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
rvelices committed Apr 2, 2012
1 parent 5fb052c commit 9c6f27c
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions i.php
Expand Up @@ -438,6 +438,7 @@ class json_response
exit;
}

include_once(PHPWG_ROOT_PATH . 'admin/include/image.class.php');
$page['coi'] = null;
if (strpos($page['src_location'], '/pwg_representative/')===false
&& strpos($page['src_location'], 'themes/')===false
Expand All @@ -446,12 +447,7 @@ class json_response
try
{
$query = '
SELECT
id,
coi,
width,
height,
rotation
SELECT *
FROM '.$prefixeTable.'images
WHERE path=\''.$page['src_location'].'\'
;';
Expand All @@ -464,9 +460,7 @@ class json_response
}
$page['coi'] = $row['coi'];

include_once(PHPWG_ROOT_PATH . 'admin/include/image.class.php');

if (empty($row['rotation']))
if (!isset($row['rotation']))
{
$page['rotation_angle'] = pwg_image::get_rotation_angle($page['src_path']);

Expand Down

0 comments on commit 9c6f27c

Please sign in to comment.