diff --git a/bridges/TwitterBridge.php b/bridges/TwitterBridge.php index 20f90d74..32ed9428 100644 --- a/bridges/TwitterBridge.php +++ b/bridges/TwitterBridge.php @@ -16,6 +16,11 @@ class TwitterBridge extends BridgeAbstract { 'name' => 'Hide images in tweets', 'type' => 'checkbox', 'title' => 'Activate to hide images in tweets' + ), + 'noimgscaling' => array( + 'name' => 'Disable image scaling', + 'type' => 'checkbox', + 'title' => 'Activate to disable image scaling in tweets (keeps original image)' ) ), 'By keyword or hashtag' => array( @@ -239,14 +244,18 @@ EOD; $image_html = ''; $image = $this->getImageURI($tweet); if(!$this->getInput('noimg') && !is_null($image)) { + // Set image scaling + $image_orig = $this->getInput('noimgscaling') ? $image : $image . ':orig'; + $image_thumb = $this->getInput('noimgscaling') ? $image : $image . ':thumb'; + // add enclosures - $item['enclosures'] = array($image . ':orig'); + $item['enclosures'] = array($image_orig); $image_html = << + + src="{$image_thumb}" /> EOD; } @@ -281,14 +290,18 @@ EOD; $quotedImage_html = ''; $quotedImage = $this->getQuotedImageURI($tweet); if(!$this->getInput('noimg') && !is_null($quotedImage)) { + // Set image scaling + $quotedImage_orig = $this->getInput('noimgscaling') ? $quotedImage : $quotedImage . ':orig'; + $quotedImage_thumb = $this->getInput('noimgscaling') ? $quotedImage : $quotedImage . ':thumb'; + // add enclosures - $item['enclosures'] = array($quotedImage . ':orig'); + $item['enclosures'] = array($quotedImage_orig); $quotedImage_html = << + + src="{$quotedImage_thumb}" /> EOD; }