Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#1883 closed defect (fixed)

Complex palette in new icons breaks Safari build

Reported by: sebastian Assignee: sebastian
Priority: P1 Milestone:
Module: Automation Keywords:
Cc: Blocked By:
Blocking: Platform: Unknown
Ready: yes Confidential: no
Tester: Verified working:
Review URL(s):

http://codereview.adblockplus.org/5195120659922944
http://codereview.adblockplus.org/4829354802544640

Description

How to reproduce

Run .build.py -t safari build

Observed behaviour

Traceback (most recent call last):
  File "./build.py", line 15, in <module>
    buildtools.build.processArgs('.', sys.argv)
  File "/home/sebastian/src/adblockpluschrome/buildtools/build.py", line 575, in processArgs
    commands[command](baseDir, scriptName, opts, args, type)
  File "/home/sebastian/src/adblockpluschrome/buildtools/build.py", line 43, in __call__
    return self._handler(baseDir, scriptName, opts, args, type)
  File "/home/sebastian/src/adblockpluschrome/buildtools/build.py", line 197, in runBuild
    releaseBuild=releaseBuild, keyFile=keyFile)
  File "/home/sebastian/src/adblockpluschrome/buildtools/packagerSafari.py", line 233, in createBuild
    convertImages(params, files)
  File "/home/sebastian/src/adblockpluschrome/buildtools/imageConversion.py", line 119, in convertImages
    image = globals()['filter_' + filter](image, baseDir, *args)
  File "/home/sebastian/src/adblockpluschrome/buildtools/imageConversion.py", line 76, in filter_contrastToAlpha
    alpha.paste(image, mask=get_alpha(image))
  File "/home/sebastian/src/adblockpluschrome/buildtools/imageConversion.py", line 27, in get_alpha
    table[transparency] = 0
TypeError: list indices must be integers, not str

This exception is raised because PIL can't parse the transparency from the palette of the new icons (#1535).

Expected behaviour

The build must not fail. The image conversion code must be able to process images with complex palette. It seems that this can easily be done by converting images with mode P (palette) to LA (grayscale + alpha).

Change History (4)

comment:1 Changed 5 years ago by sebastian

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:2 Changed 5 years ago by sebastian

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.