09-10-2023, 05:34 PM | #151 |
Sigil Developer
Posts: 8,109
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Okay tried this with Manjaro. Could Copy with no problems but the selected image never showed up in the right side pane for some reason. Tk can be a bit flakey at times.
Update: It seems only .png files will not show but jpg files will properly show. This is true on macOS as well. Also this plugin requires an epub that has been "Restructured to Sigil norm" to work as the link it provided was just way wrong otherwise. Once I did that, all seemed to work. Last edited by KevinH; 09-10-2023 at 05:45 PM. |
09-10-2023, 05:51 PM | #152 |
Grand Sorcerer
Posts: 27,947
Karma: 198500000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I discovered what was going wrong on Arch (and probably Manjaro as well):
When resizing/thumbnailing the images in the epub using Pillow's Image class, the plugin is using the Image.ANTIALIAS constant as a parameter. And that is what is silently failing on Archlinux. That's why no images show up when selecting them. From what I can tell, all Pillow resizing methods have been Antialiased since Pillow 2.7.0. At that same time, ANTIALIAS was renamed to LANCZOS. The ANTIALIAS constant was left in for backward compatibility. So it's not necessary to use it. Pillow has finally gotten around to removing the deprecated ANTIALIAS constant in Pillow v10, and that's the version of the python-pillow package in Arch's repositories. The version of Pillow included with the latest Windows and macOS versions of Sigil is Pillow 9.5.0. So the bottom line is that the first version of Pillow included with Sigil was long, long, loooong after ANTIALIAS became unnecessary (Pillow 2.7.0). Remove it in the two places in the plugin and nothing will change (except that the plugin will work with newer versions of Pillow). Last edited by DiapDealer; 09-11-2023 at 06:01 AM. |
Advert | |
|
09-10-2023, 06:43 PM | #153 |
Sigil Developer
Posts: 8,109
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Yes removing ANTIALIAS in those two places worked like a charm in Manjaro now that xclip and xsel are installed. png showed nicely as well.
On macOS, I was testing with the alice in wonderland test epub and forgot the 4 of the 5 png images where **transparent** spacer images! Once I selected a png with an actual image in it, everything worked. Thanks! Last edited by KevinH; 09-10-2023 at 06:48 PM. |
09-11-2023, 05:10 AM | #154 |
Addict
Posts: 202
Karma: 62362
Join Date: Jul 2015
Device: Sony
|
@ DiapDealer: Thanks for tracking down this issue. I have put an updated version of the plugin in the first post in this thread.
|
09-11-2023, 08:21 AM | #155 |
Grand Sorcerer
Posts: 27,947
Karma: 198500000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
No problem. More here on Pillow's 10.0 deprecation removals: https://pillow.readthedocs.io/en/sta...es/10.0.0.html
|
Advert | |
|
09-11-2023, 09:20 AM | #156 |
Groupie
Posts: 163
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6
|
Just found today that the plugin has been updated to v0.2.1.4 so I installed that to check. There was one surprise, though. It still registers in Sigil as 0.2.1.3
When I look inside its plugin.xml file, line 8 still shows: <version>0.2.1.3</version> In any case, whatever mod the developer made does not make the 'Copy' function load an image to the clipboard on my linux box. I've found the two replacements of ANTIALIAS in 0.2.1.3 lines 329, 351 by LANCZOS. It hasn't helped my flatpak installtion. Last edited by philja; 09-11-2023 at 06:10 PM. |
09-11-2023, 09:33 AM | #157 |
Sigil Developer
Posts: 8,109
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Works with Manjaro (after adding xsel and xclip). And works with Arch. Did you ever run the terminal test I posted earlier to prove if xsel -ib worked to load the word "hello" onto the clipboard? Did it work?
|
09-11-2023, 09:52 AM | #158 |
Grand Sorcerer
Posts: 27,947
Karma: 198500000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quick question: If phijla is using a Flatpak version of Sigil, can that not introduce sandbox issues? Could the problem be that Flatpak itself does not make xsel and xclip available to its apps (even if available on the host machine)?
From what I understand, you can use the following command to see what commands are available to Flatpak Sigil with the following command: Code:
flatpak enter com.sigil_ebook.Sigil /bin/bash Last edited by DiapDealer; 09-11-2023 at 10:34 AM. |
09-11-2023, 10:42 AM | #159 | |
Groupie
Posts: 163
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6
|
Quote:
In W10, the plugin gives me a message each time that an image has been copied to the clipboard. In my linux box, the plugin does not give this message so I presume the plugin has not carried out the copy procedure. |
|
09-11-2023, 10:47 AM | #160 | |
Groupie
Posts: 163
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6
|
Quote:
Re your bit of code, I copied and ran it in a terminal and it did nothing. I suppose you intended it to be run in a terminal - but where? |
|
09-11-2023, 11:23 AM | #161 |
Groupie
Posts: 163
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6
|
I've been looking deeper into why the plugin produced code does not display the images between <svg> tags in my W10 box and I've found the answer.
This is a typical piece of code produced by the plugin: Code:
<div> <svg xmlns="http://www.w3.org/2000/svg" height="100%" width="100%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 710 698" xmlns:xlink="http://www.w3.org/1999/xlink"> <image width="710" height="698" xlink:href="../Images/Pictures/circle-Fsh.gif"/> </svg> </div> Code:
<div class="Image"> <img alt="Relatives" src="Pictures/circle-Fsh.gif" width="65%"/> </div> Although the opf shows the images as having a path Pictures/image, Sigil shows 'Images' as the folder name in the browser pane. How does that magic happen? The plugin sticks '../Images/' on the front of whatever image source link it finds in the file. I have found other epubs which do not have any indication of Calibre in the opf but the images are in a directory 'images' (no capital letter) and the plugin produces the source link as Code:
<image width="724" height="721" xlink:href="../Images/images/image021.gif"/> Code:
<img alt="Image57" src="images/image021.gif" width="65%"/> In any case, as soon as the link to the image is corrected, it displays correctly. And the solution seems to be to 'restructure to Sigil Norm'. Last edited by philja; 09-11-2023 at 12:15 PM. |
09-11-2023, 11:25 AM | #162 |
Sigil Developer
Posts: 8,109
Karma: 5450184
Join Date: Nov 2009
Device: many
|
The problem is sandboxing an app like Sigil that uses PageEdit as an external editor, that uses OpenWith to open lots of third party editing tools chosen by the user including gimp, svg editors, etc, etc, and third party python plugins that can run lots of OS commands and tools (including java) just makes no sense at all. The flatpak version is quite handicapped and limited.
The right way to effectively "sandbox" an app like Sigil is to run it in a VM with a full set of other tools that can be employed with Sigil (like PageEdit, gimp java, etc etc) to make a VM playground tool). Have you thought about running a Manjaro VM (or some other linux VM that properly updates things like Sigil) on your linux box and not running flatpak? Last edited by KevinH; 09-11-2023 at 11:28 AM. |
09-11-2023, 11:27 AM | #163 | |
Sigil Developer
Posts: 8,109
Karma: 5450184
Join Date: Nov 2009
Device: many
|
See my comment about this plugin requiring you to "Restructure ePub to Sigil Norm" be run by Sigil before launching the plugin.
No all epubs follow the old Sigil norm for how folders should be used inside an epub. Even Sigil itself no longer has that limitation. Quote:
|
|
09-11-2023, 11:37 AM | #164 | ||
Grand Sorcerer
Posts: 27,947
Karma: 198500000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Quote:
So maybe first try: Code:
sudo flatpak enter com.sigil_ebook.Sigil /bin/bash Code:
sudo -E flatpak enter com.sigil_ebook.Sigil /bin/bash Last edited by DiapDealer; 09-11-2023 at 11:40 AM. |
||
09-11-2023, 05:37 PM | #165 | |
Groupie
Posts: 163
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6
|
Quote:
Code:
error: com.sigil_ebook.Sigil is neither a pid nor an application or instance ID I've been to the flathub website. Last time I when I had the inability to find java, it was really easy to find somewhere to place a query. This time, I can't find any reference to Sigil and I'll have to open an account. I'll leave that to tomorrow. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wrap in SVG plugin? | gezginrocker | Plugins | 18 | 07-05-2015 12:20 AM |
svg image on top of a background png image | roger64 | ePub | 25 | 04-24-2015 11:00 AM |
Display of a png image linked to a svg image | roger64 | Editor | 6 | 03-13-2015 06:21 AM |
Image wrap test | Jellby | ePub | 15 | 05-04-2011 02:30 PM |
Combining blockquote with image wrap | WRB | Sigil | 1 | 02-12-2011 07:46 PM |