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 12-02-2014, 07:13 PM   #31
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
If you need source packages, try checking http://archlinux.org/packages which will provide the Upstream Urls instead of repackaging the sources.

Last edited by eschwartz; 12-02-2014 at 07:17 PM.
eschwartz is offline   Reply With Quote
Old 12-02-2014, 09:38 PM   #32
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,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Hi eschwartz,

Quote:
Originally Posted by eschwartz View Post
If you need source packages, try checking http://archlinux.org/packages which will provide the Upstream Urls instead of repackaging the sources.
Thanks for the link. Unfortunately, I found out that pngout.exe is proprietary code that no source has been released for. Someone else has built a binary of it for older Macs running OS X 10.4, but I gave up running binaries I find on the web from unknown/untrusted sources long ago. I am surprised it runs on Linux.

Thanks,

Kevin
KevinH is offline   Reply With Quote
Advert
Old 12-02-2014, 10:55 PM   #33
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Oh, that seems to be priceless.
I really love closed-source linux programs, too... I am sure it runs, it just won't be packaged by anybody.

Is pngout actually being used? It probably isn't necessary, how many different png optimizers does one program need?
But assuming we want to squeeze every possible byte out, a noteworthy goal, perhaps it is a better idea to use zopflipng which is part of google's open-source zopfli compression engine (alternative to deflate, it takes 2-3 times longer in order to find the smallest compression path). It even claims to be marginally better than pngout, by a whole 0.5%
https://code.google.com/p/zopfli/sou...ADME.zopflipng
eschwartz is offline   Reply With Quote
Old 12-03-2014, 02:09 AM   #34
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
You can ignore PNGOUT. It is an old leftover I apparently forgot to delete. The reason I kicked it out, is that there is no Linux/OSX version and it is closed source (no way to rebuild if the need arises).
The program is checking what the OS is to determine how to call the image optimizing programs. If I recall correctly (will look it up later today), on Windows systems it will use the executables in the directory and for Linux (and also OSX) it should use the ones in the path. Based on your error report, it seems that it does not starts fine, it tries to open 'open'. I will get back to you.

Last edited by Toxaris; 12-03-2014 at 02:11 AM.
Toxaris is offline   Reply With Quote
Old 12-03-2014, 02:59 AM   #35
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
As it is now, I am detecting if it is running on Windows or other. If it is running on other, it will not give a pathname, but just execute the command. For jpegtran the command would be like:

jpegtran -optimize -progressive -copy none -outfile <filename> <filename>

Could you check if that is working on OSX?
Toxaris is offline   Reply With Quote
Advert
Old 12-03-2014, 09:29 AM   #36
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,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Hi Toxaris,

Will check that and get back to you. One approch to making a cross-platform plugin that has binaries might be to create your own winbin\, osxbin/, linuxbin/ directories in the plugin folder and store the small required binaries in those and then invoke them with the correct full path depending on what sys you are running on. The platform can be easily detected by python and passed in if need be.

That way, no one has to build those binaries on OSX as there are no simple packages for Mac users.

I have tried setting the path env var to point to the binaries but I am not sure since you use subprocess to invoke it if those environment vars are properly picked up in the child process or not.

KevinH
KevinH is offline   Reply With Quote
Old 12-03-2014, 09:35 AM   #37
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,957
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Toxaris View Post
As it is now, I am detecting if it is running on Windows or other. If it is running on other, it will not give a pathname, but just execute the command. For jpegtran the command would be like:

jpegtran -optimize -progressive -copy none -outfile <filename> <filename>

Could you check if that is working on OSX?
You can actually optimize the images even better as long as you first figure out if they are grayscale or RGB and apply the appropriate profile.

For RGB
jpegtran.exe" -optimize -progressive -copy none -scans jpeg_scan_rgb.txt <filename> <filename>

For grayscale
jpegtran.exe" -optimize -progressive -copy none -scans jpeg_scan_bw.txt <filename> <filename>

For PNG, there is an open source optimizer called OptiPNG that you could use. http://optipng.sourceforge.net/
There is also another free PNG optimizer called PNG Optimizer. http://sourceforge.net/projects/pngoptimizer/

Last edited by JSWolf; 12-03-2014 at 09:44 AM.
JSWolf is offline   Reply With Quote
Old 12-03-2014, 10:10 AM   #38
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,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Hi,

I think your trying to write over the same file you read from is the issue on Mac OS X.

Code:
kbhend$ ./jpegtran -optimize -progressive -copy none -outfile ../junk.jpg ../PluginRunner.jpg
It successfully creates junk.jpg with no errors.

But if I try to overwrite the same file in-place ...

Code:
kbhend$ ./jpegtran -optimize -progressive -copy none -outfile ../test.jpg ../test.jpg

Empty input file
I get back the same "Empty input file" error I saw previously.
So at least on Mac OS X you can't overwrite in place.

Hope this helps,

KevinH


Quote:
Originally Posted by Toxaris View Post
As it is now, I am detecting if it is running on Windows or other. If it is running on other, it will not give a pathname, but just execute the command. For jpegtran the command would be like:

jpegtran -optimize -progressive -copy none -outfile <filename> <filename>

Could you check if that is working on OSX?
KevinH is offline   Reply With Quote
Old 12-03-2014, 10:29 AM   #39
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by JSWolf View Post
For PNG, there is an open source optimizer called OptiPNG that you could use. http://optipng.sourceforge.net/
There is also another free PNG optimizer called PNG Optimizer. http://sourceforge.net/projects/pngoptimizer/
Tbis plugin already uses optipng.
eschwartz is offline   Reply With Quote
Old 12-03-2014, 11:46 AM   #40
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by KevinH View Post
One approch to making a cross-platform plugin that has binaries might be to create your own winbin\, osxbin/, linuxbin/ directories in the plugin folder and store the small required binaries in those and then invoke them with the correct full path depending on what sys you are running on. The platform can be easily detected by python and passed in if need be.

That way, no one has to build those binaries on OSX as there are no simple packages for Mac users.

I have tried setting the path env var to point to the binaries but I am not sure since you use subprocess to invoke it if those environment vars are properly picked up in the child process or not.

KevinH
You have a point there. The only catch would be that additional libraries would be needed, but I should be able to test that.
Toxaris is offline   Reply With Quote
Old 12-03-2014, 11:49 AM   #41
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by KevinH View Post
Hi,

I think your trying to write over the same file you read from is the issue on Mac OS X.

Code:
kbhend$ ./jpegtran -optimize -progressive -copy none -outfile ../junk.jpg ../PluginRunner.jpg
It successfully creates junk.jpg with no errors.

But if I try to overwrite the same file in-place ...

Code:
kbhend$ ./jpegtran -optimize -progressive -copy none -outfile ../test.jpg ../test.jpg

Empty input file
I get back the same "Empty input file" error I saw previously.
So at least on Mac OS X you can't overwrite in place.

Hope this helps,

KevinH
That helps a lot. Together with the new algorithm I have written to detect the OS, it would work. I think I will include the OSX executables just like the Windows executables. On Linux they can be retrieved easily enough.
Toxaris is offline   Reply With Quote
Old 12-03-2014, 12:20 PM   #42
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,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Hi Toxaris,

Quote:
Originally Posted by Toxaris View Post
That helps a lot. Together with the new algorithm I have written to detect the OS, it would work. I think I will include the OSX executables just like the Windows executables. On Linux they can be retrieved easily enough.
Glad to hear it. Do you want me to zip up the Mac OS X binaries and send them to you? Or do you want me to wait until we get something working on Mac OS X first?

Thanks,

Kevin
KevinH is offline   Reply With Quote
Old 12-03-2014, 03:07 PM   #43
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by KevinH View Post
Hi Toxaris,



Glad to hear it. Do you want me to zip up the Mac OS X binaries and send them to you? Or do you want me to wait until we get something working on Mac OS X first?

Thanks,

Kevin
Let's make it work first... I will sent you a message later with a test version...
Toxaris is offline   Reply With Quote
Old 12-03-2014, 07:43 PM   #44
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,957
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Toxaris, do you think you can implement the following so we get even better jpeg optimization?

For RGB
jpegtran.exe" -optimize -progressive -copy none -scans jpeg_scan_rgb.txt <filename> <filename>

For grayscale
jpegtran.exe" -optimize -progressive -copy none -scans jpeg_scan_bw.txt <filename> <filename>
JSWolf is offline   Reply With Quote
Old 12-04-2014, 08:54 AM   #45
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by JSWolf View Post
Toxaris, do you think you can implement the following so we get even better jpeg optimization?

For RGB
jpegtran.exe" -optimize -progressive -copy none -scans jpeg_scan_rgb.txt <filename> <filename>

For grayscale
jpegtran.exe" -optimize -progressive -copy none -scans jpeg_scan_bw.txt <filename> <filename>
No, not until I can find a good way to determine if a picture is grayscale or color.
Toxaris is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Comic optimizer script rhon Kobo Reader 0 11-08-2012 06:04 PM
Mokle - Mangas Optimizer for Kindle devorez Kindle Developer's Corner 11 08-14-2012 07:15 PM
Patent/Heavy graphics pdfs and Adobe PDF Optimizer andrewscheinman iRex 4 12-26-2009 11:39 AM
epub, ePub, EPUB, warum blos ePub? flowoeB Lounge 5 11-27-2009 09:37 AM
PRS-500 PDF file optimizer phigdon Sony Reader Dev Corner 1 04-01-2007 11:40 PM


All times are GMT -4. The time now is 10:24 PM.


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