Skip to content

Commit

Permalink
Only rotate images in dynamic view
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Jan 9, 2015
1 parent 8a8f04d commit 9b733d0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions imp/lib/Mime/Viewer/Images.php
Expand Up @@ -98,7 +98,7 @@ protected function _render()
*/
protected function _renderInline()
{
global $browser, $injector, $page_output;
global $browser, $injector, $page_output, $registry;

$type = $this->_getType();

Expand All @@ -120,8 +120,10 @@ protected function _renderInline()
'type' => 'text/html; charset=' . $this->getConfigParam('charset')
);

/* Load JPEGs via javascript to allow for rotation. */
if ($type === 'image/jpeg') {
/* Load JPEGs via javascript, in dynamic view, to allow for
* browser-side rotation. */
if (($type === 'image/jpeg') &&
($registry->getView() === $registry::VIEW_DYNAMIC)) {
$page_output->addScriptFile('external/base64.js');
$page_output->addScriptFile('external/load-image.all.min.js');
$uid = strval(new Horde_Support_Randomid());
Expand Down

0 comments on commit 9b733d0

Please sign in to comment.