Index: /extensions/TumblrShare/admin.php
===================================================================
--- /extensions/TumblrShare/admin.php	(revision 19393)
+++ /extensions/TumblrShare/admin.php	(revision 19394)
@@ -12,4 +12,5 @@
     'type' => $_POST['type'],
     'position' => $_POST['position'],
+    'img_size' => $_POST['img_size'],
     );
   
@@ -24,4 +25,6 @@
   'type' => $conf['TumblrShare']['type'],
   'position' => $conf['TumblrShare']['position'],
+  'img_size' => $conf['TumblrShare']['img_size'],
+  'img_sizes' => array_merge(ImageStdParams::get_all_types(), array('Original')),
   'TUMBLR_PATH' => TUMBLR_PATH,
 ));
Index: /extensions/TumblrShare/admin.tpl
===================================================================
--- /extensions/TumblrShare/admin.tpl	(revision 19393)
+++ /extensions/TumblrShare/admin.tpl	(revision 19394)
@@ -67,4 +67,13 @@
       </tr>
       
+      <tr class="property">
+        <td>
+          {'Shared picture size'|@translate}
+        </td>
+        <td>
+          {html_options name="img_size" values=$img_sizes output=$img_sizes|translate selected=$img_size}
+        </td>
+      </tr>
+      
       <tr class="submit">
         <td colspan="2" style="text-align:center;">
Index: /extensions/TumblrShare/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/TumblrShare/language/en_UK/plugin.lang.php	(revision 19393)
+++ /extensions/TumblrShare/language/en_UK/plugin.lang.php	(revision 19394)
@@ -6,3 +6,4 @@
 $lang['Button size'] = 'Button size';
 $lang['Share on Tumblr'] = 'Share on Tumblr';
+$lang['Shared picture size'] = 'Shared picture size';
 ?>
Index: /extensions/TumblrShare/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/TumblrShare/language/fr_FR/plugin.lang.php	(revision 19393)
+++ /extensions/TumblrShare/language/fr_FR/plugin.lang.php	(revision 19394)
@@ -6,3 +6,4 @@
 $lang['Button size'] = 'Taille du bouton';
 $lang['Share on Tumblr'] = 'Partager sur Tumblr';
+$lang['Shared picture size'] = 'Taille des photos partagées';
 ?>
Index: /extensions/TumblrShare/main.inc.php
===================================================================
--- /extensions/TumblrShare/main.inc.php	(revision 19393)
+++ /extensions/TumblrShare/main.inc.php	(revision 19394)
@@ -39,19 +39,19 @@
   if (script_basename() == 'picture')
   {
-    $current_picture = $template->get_template_vars('current');
+    global $picture;
     
     $template->assign(array(
       'TUMBLR_MODE' => 'photo',
-      'TUMBLR_URL' => $root_url.duplicate_picture_url(),
-      'TUMBLR_TITLE' => $current_picture['TITLE'],
+      'TUMBLR_URL' => $root_url.ltrim(duplicate_picture_url(), './'),
+      'TUMBLR_TITLE' => $picture['current']['TITLE'],
       ));
     
-    if (!empty($current_picture['selected_derivative']))
+    if ($conf['TumblrShare']['img_size'] == 'Original')
     {
-      $template->assign('TUMBLR_SOURCE', $root_url.$current_picture['selected_derivative']->get_url());
+      $template->assign('TUMBLR_SOURCE', $root_url.ltrim($picture['current']['src_image']->get_url(), './'));
     }
     else
     {
-      $template->assign('TUMBLR_SOURCE', $root_url.ltrim($current_picture['src_image']->rel_path, './'));
+      $template->assign('TUMBLR_SOURCE', $root_url.ltrim(DerivativeImage::url($conf['TumblrShare']['img_size'], $picture['current']['src_image']), './'));
     }
   }
@@ -62,5 +62,5 @@
     $template->assign(array(
       'TUMBLR_MODE' => 'link',
-      'TUMBLR_URL' => $root_url.duplicate_index_url(),
+      'TUMBLR_URL' => $root_url.ltrim(duplicate_index_url(), './'),
       'TUMBLR_TITLE' => strip_tags($page['title']),
       ));
Index: /extensions/TumblrShare/maintain.inc.php
===================================================================
--- /extensions/TumblrShare/maintain.inc.php	(revision 19393)
+++ /extensions/TumblrShare/maintain.inc.php	(revision 19394)
@@ -5,7 +5,20 @@
     'type' => 'share_1',
     'position' => 'toolbar',
+    'img_size' => 'Original',
     );
       
   conf_update_param('TumblrShare', serialize($tumblr_conf));
+}
+
+function plugin_activate()
+{
+  global $conf;
+  
+  $tumblr_conf = unserialize($conf['TumblrShare']);
+  if (!isset($tumblr_conf['img_size']))
+  {
+    $tumblr_conf['img_size'] = 'Original';
+    conf_update_param('TumblrShare', serialize($tumblr_conf));
+  }
 }
 
