Opened 6 years ago

Closed 6 years ago

Last modified 6 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):


How to reproduce

Run -t safari build

Observed behaviour

Traceback (most recent call last):
  File "./", line 15, in <module>'.', sys.argv)
  File "/home/sebastian/src/adblockpluschrome/buildtools/", line 575, in processArgs
    commands[command](baseDir, scriptName, opts, args, type)
  File "/home/sebastian/src/adblockpluschrome/buildtools/", line 43, in __call__
    return self._handler(baseDir, scriptName, opts, args, type)
  File "/home/sebastian/src/adblockpluschrome/buildtools/", line 197, in runBuild
    releaseBuild=releaseBuild, keyFile=keyFile)
  File "/home/sebastian/src/adblockpluschrome/buildtools/", line 233, in createBuild
    convertImages(params, files)
  File "/home/sebastian/src/adblockpluschrome/buildtools/", line 119, in convertImages
    image = globals()['filter_' + filter](image, baseDir, *args)
  File "/home/sebastian/src/adblockpluschrome/buildtools/", line 76, in filter_contrastToAlpha
    alpha.paste(image, mask=get_alpha(image))
  File "/home/sebastian/src/adblockpluschrome/buildtools/", 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 6 years ago by sebastian

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

comment:2 Changed 6 years ago by sebastian

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