Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 11-28-2015, 11:39 AM   #16
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by SHunter101 View Post
I have a feature request. I would like the ability to paste the image from clipboard to where I have positioned the cursor.
Unfortunately, it's not (yet) possible to detect the cursor position.
Doitsu is offline   Reply With Quote
Old 11-28-2015, 11:40 AM   #17
rubeus
Banned
rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.
 
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
Guess thats not possible as the plugin launcher does not know here the cursor position is/was.
rubeus is offline   Reply With Quote
Advert
Old 11-28-2015, 05:24 PM   #18
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,636
Karma: 5433388
Join Date: Nov 2009
Device: many
Simply add a unique tag or id or class name to current tab where you want the insert to occur and invoke the plugin. The plugin will get the list of the current xhtml file (highlighted in the BookBrowser) and can easily look for the unique tag, or id or class name to get any insertion point and substitute anything you want inside the plugin.
KevinH
KevinH is offline   Reply With Quote
Old 11-28-2015, 06:09 PM   #19
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by KevinH View Post
Simply add a unique tag or id or class name to current tab where you want the insert to occur and invoke the plugin. The plugin will get the list of the current xhtml file (highlighted in the BookBrowser) and can easily look for the unique tag, or id or class name to get any insertion point and substitute anything you want inside the plugin.
KevinH
That would certainly work, but, IMHO, it'd be much easier if the OP simply pressed CTRL+SHIFT+I and directly selected the image inserted by the plugin.

Somehow I don't feel inclined to add code that'd save the OP one key-press and one mouse-click.
Doitsu is offline   Reply With Quote
Old 11-29-2015, 01:09 PM   #20
SHunter101
Connoisseur
SHunter101 really knows where his or her towel isSHunter101 really knows where his or her towel isSHunter101 really knows where his or her towel isSHunter101 really knows where his or her towel isSHunter101 really knows where his or her towel isSHunter101 really knows where his or her towel isSHunter101 really knows where his or her towel isSHunter101 really knows where his or her towel isSHunter101 really knows where his or her towel isSHunter101 really knows where his or her towel isSHunter101 really knows where his or her towel is
 
Posts: 56
Karma: 70350
Join Date: May 2013
Device: Kobo AuraH2O, Glo, AuraHD, JBC2
Quote:
Originally Posted by Doitsu View Post
The jpeg image quality is hard-coded, but it can easily be changed by editing the quality value in plugin.py.
If I want the max image quality do I change img.save(clipboard_data, 'jpeg', quality=90) to 100? And do I need to change the value 90 in line 51 and 53 to 100 (using Notepad++ to get the line numbers)?

Thanks,
SH
SHunter101 is offline   Reply With Quote
Advert
Old 11-29-2015, 01:24 PM   #21
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by SHunter101 View Post
If I want the max image quality do I change img.save(clipboard_data, 'jpeg', quality=90) to 100? And do I need to change the value 90 in line 51 and 53 to 100 (using Notepad++ to get the line numbers)?
If you have a Windows machine you only need to change the following line:

Code:
                img.save(clipboard_data, 'jpeg', quality=90)
(You only need to change the quality value in lines 51 and 53 if you have a Linux machine.)

However, changing the quality to 100 is not recommended, because it'll make the image larger than the original image.

If you want to insert the image unchanged, copy the image URL to the clipboard.
Doitsu is offline   Reply With Quote
Old 02-02-2017, 12:24 PM   #22
Super T
Junior Member
Super T began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2017
Device: Boox Onyx i86
Smile

Thanks for this! GREAT idea for a plugin!

I was using a v0.6 Sigil to paste from a website and build ePubs--and the images worked.
Once I loaded in Moon+ I noticed they were broken, and in Sigil v0.9.7 there are "Get failed - protocol HTTPS is unknown" errors (╥_╥)
I now need to fix 70+ images, so thanks! This will definitely help!


I have two usability questions:
1) Could PasteImage take the image URL, add it, AND Insert it at the cursor? That would simplify things by a lot!

2) Could PasteImage parse a clipboard with html info to keep the images, without the extra step?
From https://translationchicken.com/2016/...their-oaths16/
Code:
<img src="https://translationchicken.files.wordpress.com/2016/09/arc3interludeiii.png?w=1400"
 class="attachment-baskerville-post-image size-baskerville-post-image wp-post-image" 
alt="arc3interludeiii" 
srcset="https://translationchicken.files.wordpress.com/2016/09/arc3interludeiii.png?w=1400 1400w, 
https://translationchicken.files.wordpress.com/2016/09/arc3interludeiii.png?w=150 150w, 
https://translationchicken.files.wordpress.com/2016/09/arc3interludeiii.png?w=300 300w, 
https://translationchicken.files.wordpress.com/2016/09/arc3interludeiii.png?w=768 768w, 
https://translationchicken.files.wordpress.com/2016/09/arc3interludeiii.png?w=1024 1024w, 
https://translationchicken.files.wordpress.com/2016/09/arc3interludeiii.png 1600w" 
sizes="(max-width: 1400px) 100vw, 1400px" data-attachment-id="2919" 
data-permalink="https://translationchicken.com/arc3interludeiii/" 
data-orig-file="https://translationchicken.files.wordpress.com/2016/09/arc3interludeiii.png" 
data-orig-size="1600,900" data-comments-opened="1" 
data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" 
data-image-title="arc3interludeiii" data-image-description="" 
data-medium-file="https://translationchicken.files.wordpress.com/2016/09/arc3interludeiii.png?w=300" 
data-large-file="?w=736" width="1400" height="788"/>			
</div>
<div class="post-content clear">
<h6 style="text-align:left;">*******Note from Translation Chicken*******</h6>
Sigil prompts asking if I want to paste Plaintext, I hit No, and so the text pastes correctly but the image is broken.
If this code was on the clipboard, could PasteImage be changed to paste it better?

Thanks again for a great plugin!
Super T is offline   Reply With Quote
Old 02-02-2017, 12:37 PM   #23
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Super T View Post
I now need to fix 70+ images, so thanks! This will definitely help!
In that case Calibre Editor might be a better choice. It allows you to check and download external resources:

Tools > External Links > Check external links
Tools > External Links > Download external resources

There are also a couple of browser plugins that'll save websites as ebooks, e.g. dotEpub.
Doitsu is offline   Reply With Quote
Old 02-02-2017, 02:04 PM   #24
Super T
Junior Member
Super T began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2017
Device: Boox Onyx i86
Oh, neat! I did not know it did that.
Thanks!
Super T is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Clipboard Search kiwidude Plugins 29 04-02-2024 10:05 PM
new feature request - paste image support dhdurgee Sigil 16 11-22-2015 06:29 AM
Troubleshooting Paste wifi password into text file? garyyoung Amazon Kindle 9 07-08-2014 12:15 AM
How do I copy and paste an image into the body? Gregg Bell Feedback 26 02-06-2013 10:42 PM
copy and paste with image pdf kab enTourage Archive 12 04-27-2010 02:32 PM


All times are GMT -4. The time now is 04:27 PM.


MobileRead.com is a privately owned, operated and funded community.