[mythtv-users] MythArchive fails during Menu creation

John Pilkington johnpilk222 at gmail.com
Wed Aug 8 12:17:20 UTC 2018


On 07/08/18 20:24, Andrew Stadt wrote:
> On 07/08/18 01:48 PM, John Pilkington wrote:
>> I used to create lots of DVD images but haven't done so recently;  a 
>> library of DVDs takes up too much space.  But I just tried again and 
>> it failed.  I was trying to convert from mythlink 'Videos' but it 
>> fails with Recordings too.
>>
>> The theme, and the line numbers in mythburn.py, will be non-standard.
>>
>> This is on my fc27 box running V30-Pre-11d42...  mythburn.py line 1 is:
>>
>> #! /usr/bin/python2
>>
>> Googling 'cannot write mode RGBA as JPEG' gets lots of hits, which I 
>> haven't yet studied.  Has anyone else?
>>
>> {{{
>>
>> Added button image /usr/share/mythtv/mytharchive/images/next.png
>> Added next page button
>> ------------------------------------------------------------
>> Traceback (most recent call last):
>>   File "/usr/share/mythtv/mytharchive/scripts/mythburn.py", line 5341, 
>> in main
>>     processJob(job)
>>   File "/usr/share/mythtv/mytharchive/scripts/mythburn.py", line 5039, 
>> in processJob
>>     createMenu(format, dpi, files.length)
>>   File "/usr/share/mythtv/mytharchive/scripts/mythburn.py", line 3685, 
>> in createMenu
>>     bgimage.save(os.path.join(getTempPath(),"background-%s.jpg" % 
>> page),"JPEG", quality=99)
>>   File "/usr/lib64/python2.7/site-packages/PIL/Image.py", line 1928, 
>> in save
>>     save_handler(self, fp, filename)
>>   File "/usr/lib64/python2.7/site-packages/PIL/JpegImagePlugin.py", 
>> line 607, in _save
>>     raise IOError("cannot write mode %s as JPEG" % im.mode)
>> IOError: cannot write mode RGBA as JPEG
>> ------------------------------------------------------------
>> Saving settings: host hp_fed1, name MythArchiveLastRunStatus, data Failed
>> Saving settings: host hp_fed1, name MythArchiveLastRunEnd, data 
>> 2018-08-07 13:54:02
>>
>> )))
>>
>> John P
>>
> Apparently the jpeg library will now refuse to attempt to save images 
> with an alpha channel as jpegs (which don't support alpha).
> 
> I'm not sure who is maintaining mythburn at the moment, but I guess you 
> have two options.  1. Choose a background image with no alpha channel, 
> or patch the code to flatten the image if it has an alpha channel.
> 
> On my phone at the moment, so really can't come up more.
> 

Thanks. It looks as if assembling the menu screen depends on alpha to 
distinguish previews from background.  Maybe a simpler theme will work - 
otherwise it looks as if will be messy.  Or maybe replacing jpeg by png 
is worth a try.  I've never got into this...
-------------

I tried a short test DVD-build on the el7 box running mythtv from the 
same git commit.  It worked.  So much for progress :-(

I think these packages are involved.

fc27 python2-2.7.15-2      python2-pillow-4.3.0-1.

There's a report that pillow-4.1.1 didn't have the issue.

Pillow release notes for 4.2.0 :

Before Pillow 4.2.0, attempting to save an RGBA image as JPEG would 
discard the alpha channel. From Pillow 3.4.0, a deprecation warning was 
shown. From Pillow 4.2.0, the deprecation warning is removed and an 
:py:exc:`IOError` is raised.

so perhaps the alpha channel isn't needed - or 2.0 is considered prehistory?

SL7.5 (el7.5) python2 --version Python 2.7.5

$ rpm -qa | grep pillow
python-pillow-2.0.0-19.gitd1c6db8.el7.x86_64


More information about the mythtv-users mailing list