MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Plugins (https://www.mobileread.com/forums/forumdisplay.php?f=268)
-   -   Plugin to insert and wrap an image with SVG (https://www.mobileread.com/forums/showthread.php?t=283333)

asleyam 06-29-2019 10:32 PM

Quote:

Originally Posted by KevinH (Post 3862006)
Mac Users - please make sure you have installed ActiveState's ActiveTCL for Mac version 8.6.x just to doublecheck.

I have this one installed - ActiveTcl-8.6.9.8609.2-macosx10.9-x86_64-93b04018.

KevinH 07-02-2019 09:03 AM

Okay, I can reproduce exactly this problem on my dev machine. It is PIL related and has to do with running a size bomb test on the jpeg contents. I will get this fixed for the upcoming non-beta version.

KevinH 07-02-2019 12:04 PM

I have tracked this one down to newer Pillow versions actually importing from distutils just to spawn a process (not the right way!) and to check versions but only for jpeg and tiff images.

distutils is supposed to be used when a package is being installed, not for day to day working of the package. For that reason distutils was not part of the mac embedded Python interpreter as it should be unneeded by already installed packages.

I have now added back in distutils so that newer versions of Pillow will function.

This bug fix has been pushed to master and will appear in the upcoming version (non-beta) of Sigil.

Thank you for your bug report.

odamizu 07-21-2019 02:29 AM

InsertImageSVG plugin working great on 0.9.16. Thank you so much!

Quote:

Originally Posted by KevinH (Post 3863015)
I have tracked this one down to newer Pillow versions ... This bug fix has been pushed to master and will appear in the upcoming version (non-beta) of Sigil.

Thank you for your bug report.


odamizu 11-11-2019 03:28 AM

Hi CalibUser! Running InsertImageSVG plugin on Sigil 0.9.991 with epub having non-Sigil-standard structure results in wrong filepath, so the image isn't found.

Standardizing epub structure with Tools > Restructure Epub to Sigil Norm solves the problem and allows the plugin to run successfully.

ETA: Fixing the filepath manually also works :)

CalibUser 11-12-2019 07:23 AM

@odamizu: Thanks for sharing this solution with the Sigil community.

DiapDealer 11-12-2019 07:39 AM

For the record: we noted this workaround in the plugin development thread where we posted the info about how to make sure plugins were compatible with the new plugin framework that will be a part of Sigil 1.0.

It was always our plan that all plugins would still function correctly so long as epubs had the traditional Sigil structure. We wanted to make sure users wouldn't have to do without their favorite plugins, and that plugin-devs didn't have to scramble madly to fix their suddenly broken plugins.

The Sigil 0.9.991 pre-release was also intended as a means for plugin devs to test their plugins to see if they were able to work with alternatively structured epubs (which Sigil 1.0 will support), or if there were modifications needed to be made.

The manual conversion to Sigil's traditional structure will provide a workaround for those plugins that may need tweaking in the interim.

KevinH 11-12-2019 10:50 AM

And I would we willing to help any plugin developer fix any of their plugins to work for both the old and new structures. Just ask.

KevinH

DiapDealer 11-12-2019 12:20 PM

Yes. Same goes for me.

I did make a quick tweak to this plugin yesterday as "proof of concept" for alternatively structured epubs. It's not exhaustive by any means, but it allowed at least partial functionality (images already internal to the epub) in my testing. It shouldn't take a ton of effort to get rid of the hard-coded "../Text/" or "../Image/ assumptions being made.

odamizu 11-12-2019 06:16 PM

Quote:

Originally Posted by DiapDealer (Post 3915018)
For the record: we noted this workaround in the plugin development thread where we posted the info about how to make sure plugins were compatible with the new plugin framework that will be a part of Sigil 1.0 ...

Yes, that's how I knew to try this workaround :)

patrik 01-09-2020 11:55 AM

It seems the path to the images may be incorrect when editing an epub not following Sigil's typical layout. (It works if you let Sigil re-structure the epub, or removing the path to the image file.)

Could you please update your excellent plugin for Sigil 1.0.0 use?

Thanks, :)

CalibUser 01-12-2020 07:45 AM

Quote:

Originally Posted by patrik (Post 3939247)
It seems the path to the images may be incorrect when editing an epub not following Sigil's typical layout. (It works if you let Sigil re-structure the epub, or removing the path to the image file.)

Could you please update your excellent plugin for Sigil 1.0.0 use?

Thanks, :)

Thank you for your suggestion. Unfortunately I am busy on other (not Sigil) projects at the moment so I will not be able to adapt this plugin at present. Also, I will need time to get my head around the code that is needed to cope with the structures that the latest version of Sigil allows. :blink:

Thomas_AR 06-19-2020 05:08 PM

Hi folks,
getting suddenly this error message. Now changes or updates of any kind.
Sigil 0.9.14
Code:

Status: failed

Default file path:  F:\Media\Images
Traceback (most recent call last):
  File "C:\Program Files\Sigil\plugin_launchers\python\launcher.py", line 135, in launch
    self.exitcode = target_script.run(container)
  File "C:\Users\Thomas\AppData\Local\sigil-ebook\sigil\plugins\InsertImageSVG\plugin.py", line 537, in run
    CheckForUpdates(root, prefs, url)
  File "C:\Users\Thomas\AppData\Local\sigil-ebook\sigil\plugins\InsertImageSVG\UpdateChecker.py", line 244, in CheckForUpdates
    NextCheckdt = datetime.strptime(prefs['NextCheckTime'], "%Y-%m-%d %H:%M:%S.%f")
  File "_strptime.py", line 577, in _strptime_datetime
  File "_strptime.py", line 359, in _strptime
ValueError: time data '2020-06-19 15:54:42' does not match format '%Y-%m-%d %H:%M:%S.%f'
Error: time data '2020-06-19 15:54:42' does not match format '%Y-%m-%d %H:%M:%S.%f'

Thomas

P.S. Problem solved by deleting the plugins preference file and reinstalled it.

RbnJrg 12-15-2021 08:49 AM

A request
 
Would it possible to add the option to insert the svg wrapper not in a new .xhtml file but in the page (file), and the place, where the cursor is positionated?
Thanks in advance for considering if this solicitude is or not doable.

CalibUser 12-16-2021 10:26 AM

@RbnJrg: I think your suggestion would need a different plugin; it is relatively easy to insert a new page in an ePub using Sigil, but I think your suggestion would require the ePub to be unzipped so that an existing page could be modified to incorporate the svg wrapper and then zipped up again.


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

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.