[Openlp-core] [Merge] lp:~raoul-snyman/openlp/wix-packaging into lp:openlp/packaging

2019-05-02 Thread Raoul Snyman
The proposal to merge lp:~raoul-snyman/openlp/wix-packaging into 
lp:openlp/packaging has been updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~raoul-snyman/openlp/wix-packaging/+merge/365880
-- 
Your team OpenLP Core is subscribed to branch lp:openlp/packaging.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] [Merge] lp:~bastian-germann/openlp/pymupdf into lp:openlp

2019-05-02 Thread noreply
The proposal to merge lp:~bastian-germann/openlp/pymupdf into lp:openlp has 
been updated.

Status: Needs review => Merged

For more details, see:
https://code.launchpad.net/~bastian-germann/openlp/pymupdf/+merge/366851
-- 
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


Re: [Openlp-core] [Merge] lp:~bastian-germann/openlp/pymupdf into lp:openlp

2019-05-02 Thread Phill
Review: Approve


-- 
https://code.launchpad.net/~bastian-germann/openlp/pymupdf/+merge/366851
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] [Merge] lp:~tomasgroth/openlp/portable-path into lp:openlp

2019-05-02 Thread noreply
The proposal to merge lp:~tomasgroth/openlp/portable-path into lp:openlp has 
been updated.

Status: Needs review => Merged

For more details, see:
https://code.launchpad.net/~tomasgroth/openlp/portable-path/+merge/366785
-- 
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


Re: [Openlp-core] [Merge] lp:~bastian-germann/openlp/pymupdf into lp:openlp

2019-05-02 Thread Tomas Groth
Review: Approve


-- 
https://code.launchpad.net/~bastian-germann/openlp/pymupdf/+merge/366851
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] Linux Test Results: Passed

2019-05-02 Thread Raoul Snyman
Linux tests passed!
-- 
https://code.launchpad.net/~bastian-germann/openlp/pymupdf/+merge/366851
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] [Merge] lp:~bastian-germann/openlp/pymupdf into lp:openlp

2019-05-02 Thread Bastian Germann
The proposal to merge lp:~bastian-germann/openlp/pymupdf into lp:openlp has 
been updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~bastian-germann/openlp/pymupdf/+merge/366835
-- 
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] [Merge] lp:~bastian-germann/openlp/pymupdf into lp:openlp

2019-05-02 Thread Bastian Germann
Bastian Germann has proposed merging lp:~bastian-germann/openlp/pymupdf into 
lp:openlp.

Commit message:
Add PyMuPDF as additional PDF controller and missing mupdf file formats

Requested reviews:
  Tomas Groth (tomasgroth)
  Phill (phill-ridout)

For more details, see:
https://code.launchpad.net/~bastian-germann/openlp/pymupdf/+merge/366851

PyMuPDF itself is GPLv3+ licenced. However, MuPDF is AGPLv3+ licenced. You can 
argue that calling the executable via subprocess does not make OpenLP a 
derivative work of MuPDF, however, using the library this argument does not 
hold. So if the new code is used, people running OpenLP with PyMuPDF have to 
comply with AGPLv3+. That means the source code of the actual running MuPDF has 
to be provided to remote users (if there are any). For the original MuPDF 
versions this is done by MuPDF's authors. If someone has changes to MuPDF, 
these changes would have to be provided via a network service to remote users.

People who have private changes to MuPDF will probably know about their 
obligations.
As a reminder I used agpl-pdf as a keyword for the dependency.
-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/plugins/presentations/lib/messagelistener.py'
--- openlp/plugins/presentations/lib/messagelistener.py	2019-04-13 13:00:22 +
+++ openlp/plugins/presentations/lib/messagelistener.py	2019-05-02 17:33:11 +
@@ -333,7 +333,8 @@
 # the conversion has already been done at this point.
 file_type = file_path.suffix.lower()[1:]
 if file_type in PDF_CONTROLLER_FILETYPES:
-log.debug('Converting from pdf/xps/oxps to images for serviceitem with file {name}'.format(name=file_path))
+log.debug('Converting from pdf/xps/oxps/epub/cbz/fb2 to images for serviceitem with file {name}'
+  .format(name=file_path))
 # Create a copy of the original item, and then clear the original item so it can be filled with images
 item_cpy = copy.copy(item)
 item.__init__(None)

=== modified file 'openlp/plugins/presentations/lib/pdfcontroller.py'
--- openlp/plugins/presentations/lib/pdfcontroller.py	2019-04-13 13:00:22 +
+++ openlp/plugins/presentations/lib/pdfcontroller.py	2019-05-02 17:33:11 +
@@ -34,9 +34,15 @@
 if is_win():
 from subprocess import STARTUPINFO, STARTF_USESHOWWINDOW
 
+try:
+import fitz
+PYMUPDF_AVAILABLE = True
+except ImportError:
+PYMUPDF_AVAILABLE = False
+
 log = logging.getLogger(__name__)
 
-PDF_CONTROLLER_FILETYPES = ['pdf', 'xps', 'oxps']
+PDF_CONTROLLER_FILETYPES = ['pdf', 'xps', 'oxps', 'epub', 'cbz', 'fb2']
 
 
 class PdfController(PresentationController):
@@ -121,6 +127,9 @@
 self.mudrawbin = program_path
 elif program_type == 'mutool':
 self.mutoolbin = program_path
+elif PYMUPDF_AVAILABLE:
+self.also_supports = ['xps', 'oxps', 'epub', 'cbz', 'fb2']
+return True
 else:
 # Fallback to autodetection
 application_path = AppLocation.get_directory(AppLocation.AppDir)
@@ -147,12 +156,11 @@
 elif (application_path / 'mutool').is_file():
 self.mutoolbin = application_path / 'mutool'
 if self.mudrawbin or self.mutoolbin:
-self.also_supports = ['xps', 'oxps']
+self.also_supports = ['xps', 'oxps', 'epub', 'cbz', 'fb2']
 return True
 elif self.gsbin:
 return True
-else:
-return False
+return False
 
 def kill(self):
 """
@@ -276,6 +284,16 @@
'-r{res}'.format(res=resolution), '-dTextAlphaBits=4', '-dGraphicsAlphaBits=4',
'-sOutputFile={output}'.format(output=temp_dir_path / 'mainslide%03d.png'),
str(self.file_path)], startupinfo=self.startupinfo)
+elif PYMUPDF_AVAILABLE:
+log.debug('loading presentation using PyMuPDF')
+pdf = fitz.open(str(self.file_path))
+for i, page in enumerate(pdf, start=1):
+src_size = page.bound().round()
+# keep aspect ratio
+scale = min(size.width() / src_size.width, size.height() / src_size.height)
+m = fitz.Matrix(scale, scale)
+page.getPixmap(m, alpha=False).writeImage(str(temp_dir_path / 'mainslide{:03d}.png'.format(i)))
+pdf.close()
 created_files = sorted(temp_dir_path.glob('*'))
 for image_path in created_files:
 if image_path.is_file():

=== modified file 'scripts/appveyor.yml'
--- scripts/appveyor.yml	2019-04-02 00:05:46 +
+++ scripts/appveyor.yml	2019-05-02 17:33:11 +
@@ -16,11 +16,7 @@
 
 install:
   # Install dependencies from pypi
-  - "%PYTHON%\\python.exe -m pip install sqlalchemy 

[Openlp-core] Linting: Passed

2019-05-02 Thread Raoul Snyman
Linting passed!
-- 
https://code.launchpad.net/~bastian-germann/openlp/pymupdf/+merge/366851
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] macOS Test Results: Passed

2019-05-02 Thread Raoul Snyman
macOS tests passed!
-- 
https://code.launchpad.net/~bastian-germann/openlp/pymupdf/+merge/366851
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] Linux Test Results: Passed

2019-05-02 Thread Raoul Snyman
Linux tests passed!
-- 
https://code.launchpad.net/~bastian-germann/openlp/pymupdf/+merge/366835
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


Re: [Openlp-core] [Merge] lp:~bastian-germann/openlp/pymupdf into lp:openlp

2019-05-02 Thread Raoul Snyman
OK, I've installed PyMuPDF.
-- 
https://code.launchpad.net/~bastian-germann/openlp/pymupdf/+merge/366835
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] Linting: Failed

2019-05-02 Thread Raoul Snyman
Linting failed, please see https://ci.openlp.io/job/MP-03-Linting/84/ for more 
details
-- 
https://code.launchpad.net/~bastian-germann/openlp/pymupdf/+merge/366835
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] Linux Test Results: Failed

2019-05-02 Thread Raoul Snyman
Linux tests failed, please see https://ci.openlp.io/job/MP-02-Linux_Tests/137/ 
for more details
-- 
https://code.launchpad.net/~bastian-germann/openlp/pymupdf/+merge/366835
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


Re: [Openlp-core] [Merge] lp:~bastian-germann/openlp/pymupdf into lp:openlp

2019-05-02 Thread Bastian Germann
@raoul-snyman Would you please install PyMuPDF for the test environment?
-- 
https://code.launchpad.net/~bastian-germann/openlp/pymupdf/+merge/366835
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] [Merge] lp:~bastian-germann/openlp/pymupdf into lp:openlp

2019-05-02 Thread Bastian Germann
Bastian Germann has proposed merging lp:~bastian-germann/openlp/pymupdf into 
lp:openlp.

Commit message:
Add PyMuPDF as additional PDF controller and missing mupdf file formats

Requested reviews:
  Tomas Groth (tomasgroth)
  Phill (phill-ridout)

For more details, see:
https://code.launchpad.net/~bastian-germann/openlp/pymupdf/+merge/366835

PyMuPDF itself is GPLv3+ licenced. However, MuPDF is AGPLv3+ licenced. You can 
argue that calling the executable via subprocess does not make OpenLP a 
derivative work of MuPDF, however, using the library this argument does not 
hold. So if the new code is used, people running OpenLP with PyMuPDF have to 
comply with AGPLv3+. That means the source code of the actual running MuPDF has 
to be provided to remote users (if there are any). For the original MuPDF 
versions this is done by MuPDF's authors. If someone has changes to MuPDF, 
these changes would have to be provided via a network service to remote users.

People who have private changes to MuPDF will probably know about their 
obligations.
As a reminder I used agpl-pdf as a keyword for the dependency.
-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/plugins/presentations/lib/messagelistener.py'
--- openlp/plugins/presentations/lib/messagelistener.py	2019-04-13 13:00:22 +
+++ openlp/plugins/presentations/lib/messagelistener.py	2019-05-02 13:53:57 +
@@ -333,7 +333,7 @@
 # the conversion has already been done at this point.
 file_type = file_path.suffix.lower()[1:]
 if file_type in PDF_CONTROLLER_FILETYPES:
-log.debug('Converting from pdf/xps/oxps to images for serviceitem with file {name}'.format(name=file_path))
+log.debug('Converting from pdf/xps/oxps/epub/cbz/fb2 to images for serviceitem with file {name}'.format(name=file_path))
 # Create a copy of the original item, and then clear the original item so it can be filled with images
 item_cpy = copy.copy(item)
 item.__init__(None)

=== modified file 'openlp/plugins/presentations/lib/pdfcontroller.py'
--- openlp/plugins/presentations/lib/pdfcontroller.py	2019-04-13 13:00:22 +
+++ openlp/plugins/presentations/lib/pdfcontroller.py	2019-05-02 13:53:57 +
@@ -34,9 +34,15 @@
 if is_win():
 from subprocess import STARTUPINFO, STARTF_USESHOWWINDOW
 
+try:
+import fitz
+PYMUPDF_AVAILABLE = True
+except ImportError:
+PYMUPDF_AVAILABLE = False
+
 log = logging.getLogger(__name__)
 
-PDF_CONTROLLER_FILETYPES = ['pdf', 'xps', 'oxps']
+PDF_CONTROLLER_FILETYPES = ['pdf', 'xps', 'oxps', 'epub', 'cbz', 'fb2']
 
 
 class PdfController(PresentationController):
@@ -121,6 +127,9 @@
 self.mudrawbin = program_path
 elif program_type == 'mutool':
 self.mutoolbin = program_path
+elif PYMUPDF_AVAILABLE:
+self.also_supports = ['xps', 'oxps', 'epub', 'cbz', 'fb2']
+return True
 else:
 # Fallback to autodetection
 application_path = AppLocation.get_directory(AppLocation.AppDir)
@@ -147,12 +156,11 @@
 elif (application_path / 'mutool').is_file():
 self.mutoolbin = application_path / 'mutool'
 if self.mudrawbin or self.mutoolbin:
-self.also_supports = ['xps', 'oxps']
+self.also_supports = ['xps', 'oxps', 'epub', 'cbz', 'fb2']
 return True
 elif self.gsbin:
 return True
-else:
-return False
+return False
 
 def kill(self):
 """
@@ -276,6 +284,16 @@
'-r{res}'.format(res=resolution), '-dTextAlphaBits=4', '-dGraphicsAlphaBits=4',
'-sOutputFile={output}'.format(output=temp_dir_path / 'mainslide%03d.png'),
str(self.file_path)], startupinfo=self.startupinfo)
+elif PYMUPDF_AVAILABLE:
+log.debug('loading presentation using PyMuPDF')
+pdf = fitz.open(str(self.file_path))
+for i, page in enumerate(pdf, start=1):
+src_size = page.bound().round()
+# keep aspect ratio
+scale = min(size.width() / src_size.width, size.height() / src_size.height)
+m = fitz.Matrix(scale, scale)
+page.getPixmap(m, alpha=False).writeImage(str(temp_dir_path / 'mainslide{:03d}.png'.format(i)))
+pdf.close()
 created_files = sorted(temp_dir_path.glob('*'))
 for image_path in created_files:
 if image_path.is_file():

=== modified file 'scripts/appveyor.yml'
--- scripts/appveyor.yml	2019-04-02 00:05:46 +
+++ scripts/appveyor.yml	2019-05-02 13:53:57 +
@@ -16,11 +16,7 @@
 
 install:
   # Install dependencies from pypi
-  - "%PYTHON%\\python.exe -m pip install sqlalchemy alembic appdirs chardet 

[Openlp-core] [Merge] lp:~bastian-germann/openlp/pymupdf into lp:openlp

2019-05-02 Thread Bastian Germann
The proposal to merge lp:~bastian-germann/openlp/pymupdf into lp:openlp has 
been updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~bastian-germann/openlp/pymupdf/+merge/366749
-- 
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


Re: [Openlp-core] [Merge] lp:~trb143/openlp/more_media into lp:openlp

2019-05-02 Thread Tomas Groth
Review: Needs Fixing

I tried running the branch on a windows system which I then realized didn't 
have VLC. But it resulted in this traceback: https://bin.snyman.info/mmmvuquw
-- 
https://code.launchpad.net/~trb143/openlp/more_media/+merge/366608
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


Re: [Openlp-core] [Merge] lp:~bastian-germann/openlp/pymupdf into lp:openlp

2019-05-02 Thread Tomas Groth
Could you please add the additional file types supported by mupdf: *.epub, 
*.cbz and *.fb2.
These should also be added for the binary mupdf.
-- 
https://code.launchpad.net/~bastian-germann/openlp/pymupdf/+merge/366749
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


Re: [Openlp-core] [Merge] lp:~tomasgroth/openlp/portable-path into lp:openlp

2019-05-02 Thread Tim Bentley
Review: Approve


-- 
https://code.launchpad.net/~tomasgroth/openlp/portable-path/+merge/366785
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


Re: [Openlp-core] [Merge] lp:~bastian-germann/openlp/pymupdf into lp:openlp

2019-05-02 Thread Phill
Review: Needs Fixing

Ok, I'm happy with adding pymupdf, however, I've spoken to Tomas, and we think 
it would be better if pymupdf was in the first if block and then it would take 
precedence over the binary if pymupdf was installed.

Also, can you add a test please?
-- 
https://code.launchpad.net/~bastian-germann/openlp/pymupdf/+merge/366749
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


Re: [Openlp-core] [Merge] lp:~tomasgroth/openlp/portable-path into lp:openlp

2019-05-02 Thread Phill
Review: Approve

Thanks
-- 
https://code.launchpad.net/~tomasgroth/openlp/portable-path/+merge/366785
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp