Page 6 of 7
Re: GUI file converter app and its commands
Posted: Thu Sep 23, 2021 5:13 pm
by SwampRabbit
TimothySimon wrote: Thu Sep 23, 2021 2:22 pm
Fact 1: LibreOffice is HUGE.
Fact 2: We need it for document conversion.
What I chose: libreoffice is now "recommended" (is this a good practice ?)
You can have libreoffice as a "recommend", is it a good practice, sure... nothing wrong with that, are there better options... maybe...
I tried to quickly locate what in libreoffice is actually responsible for the conversions, couldn't find it yet.
If it is just one or two components and libraries that are needed, its better to just have those or use something else to provide this. Edit: yeah it appears to all feed off libreoffice needing installed, could be wrong
One option is to convert using smaller tools OR with libreoffice if its installed.
The reason I say that its better is that for people that don't want or need the whole libreoffice suite, they lose this functionality completely. Plus file-converter goes from a small and portable tool to something requiring massive dependencies with even more dependencies.
Maybe some of the tools needed for converting some file formats are installed OOTB in many distros already?
A good example is the antiX/MX base and MX Workbench, file-converter would be great for those, but they don't come with libreoffice OOTB. Why can't I at least convert something from html to .odf if I have a smaller tool that can do it installed already?
I'm not really familiar with document conversion, but I think there are other options, although it might not be as simple as just requiring libreoffice... but...
I think it makes file-converter more attractive to more users, more modular, more portable, and maybe even more useful in the long run.
Maybe someone (we have people here who know this stuff pretty good) else knows of any of viable options to use?
Re: GUI file converter app and its commands
Posted: Fri Sep 24, 2021 4:35 pm
by Amigo
Good day everyone
Congratulations
@TimothySimon and
@SwampRabbit for the New release: 0.3-beta
You two make a great team!
One idea and Improved icon version
- Idea - Replacing LO utilities using pandoc
For document conversions maybe you can use pandoc instead LO (I'm not familiar with this but want to give it a try to know what is it about)
Website
https://pandoc.org/
https://github.com/jgm/pandoc
Examples
https://pandoc.org/demos.html
I tried the MXPI stable repository version (117MB)
I tested some combinations, some worked and some didn't (I think it needs more research).
Below a few results
.odt to .html --> (Worked!)
Code: Select all
pandoc example1.odt -o example1.html
The other way around not
.docx to .odt --> (Worked!)
Code: Select all
pandoc example2.docx -o example2.odt
The other way around not
Convert all the .odt files in a folder into .html --> (Worked!)
Code: Select all
for i in *.odt; do pandoc "$i" -o "${i/.odt/}.html";done;
The same above trying .docx to .html didn't work
NOTE: The conversions that I tried worked only once, Then I just got ">" in the terminal and it didn't do anything (a bug maybe?)
Perhaps you can give it a try.
- Improved icon version
Please find attached the new one (icon) looks much better than the previous
Hope that helps
Saludos
Re: GUI file converter app and its commands
Posted: Fri Sep 24, 2021 6:50 pm
by oops
... Good idea this script.
Can also be a new Thunar action (it's more user friendly into XFCE, for me - than a drag and drop)
Re: GUI file converter app and its commands
Posted: Fri Sep 24, 2021 7:36 pm
by SwampRabbit
oops wrote: Fri Sep 24, 2021 6:50 pm
... Good idea this script.
Can also be a new Thunar action (it's more user friendly into XFCE, for me - than a drag and drop)
I think each type of conversion would have to be it’s own action would it? That’s a ton of custom actions. This allows tons of different types of conversions through a simple small GUI.
Re: GUI file converter app and its commands
Posted: Fri Sep 24, 2021 8:13 pm
by oops
@SwampRabbit I probably don't exactly understand what you mean ... but it's easier for me to select some files into thunar then right click and click to the Thunar action to have the GUI, than select some files then drag and drop to an other window to have the same GUI converter.
Re: GUI file converter app and its commands
Posted: Fri Sep 24, 2021 8:41 pm
by SwampRabbit
oops wrote: Fri Sep 24, 2021 8:13 pm
@SwampRabbit I probably don't exactly understand what you mean ... but it's easier for me to select some files into thunar then right click and click to the Thunar action to have the GUI, than select some files then drag and drop to an other window to have the same GUI converter.
There isn’t a single Thunar action that can convert 50 different file types to 50 other different files types that I am aware of. I don’t thing you can make a Thunar action to do this, it’s have to be a actual Thunar plugin, which in that case, it’s pretty much the same as this.
This isn’t a simple one file type to one file type thing.
Have you even tried what TimothySimon has made?
Re: GUI file converter app and its commands
Posted: Sat Sep 25, 2021 11:31 am
by TimothySimon
Amigo wrote: Fri Sep 24, 2021 4:35 pm
...........
@SwampRabbit
Is there a way to declare EITHER pandoc OR libreoffice as a dependency (the dependency should be satisfied if ANY ONE is installed).
If so, I think I can proceed with this (use pandoc ONLY IF libreoffice isn't available.)
Re: GUI file converter app and its commands
Posted: Sat Sep 25, 2021 12:07 pm
by SwampRabbit
In the packaging you use a pipe, it acts as OR.
So like to change the Recommends to
Then if you need more for different types of conversions it would be like
Code: Select all
libreoffice | pandoc; something | something
In the app code you’d pretty much do the same process except a bit more granular obviously and I’d think the file types would have to be split up a bit because both those can’t convert all the same file types.
Even pandoc is kinda big in the grand scheme of things, not overly big, but for example if you could convert just .doc, .docx, or .odf with something smaller like in the kB range… you could make that a hard runtime dependency and get those “common/most used” that conversion functionality OOTB and for others keep the larger dependencies as Recommends.
Really depends on what you’re aiming for use cases OOTB wise and the audience your targeting.
I’d experiment with having as many small dependencies (maybe not even pandoc OOTB) providing the most core functionality, but if a user already has the larger dependencies those could be used.
For some there’s a big difference between a 5-25MB application (application + dependencies) providing the 100 format conversions that most people need than a 300MB one doing an extra 100 format conversions that most would never use.
Re: GUI file converter app and its commands
Posted: Sat Sep 25, 2021 12:42 pm
by TimothySimon
Thanks for the info.
So, would it be better to keep LO as a recommend and not use pandoc until a lighter alternative is found ?
Re: GUI file converter app and its commands
Posted: Sat Sep 25, 2021 12:53 pm
by SwampRabbit
That depends how much flexibility you want to code into file-converter, but the way you have it now is fine for the time being.
Most Linux Distros have Libreoffice OOTB, not sure about pandoc, can’t check as I’m traveling.
But for core/minimal installs pandoc might be enough of a extra install.
What can LibreOffice convert that pandoc can’t?
Finding (or creating) a matrix of file conversion tools and what they can convert might help identify the “biggest bang for the buck” as they say or identify if say a dozen small dependencies can do the job. Having a matrix like this in the GitHub README or GitHub Wiki of you start one… would be useful to users too.