mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-31 21:41:33 +00:00
Fixing massive icon problems by removing support for Windows ICO files.
This commit is contained in:
parent
403a4ced90
commit
b746dda72d
1 changed files with 3 additions and 7 deletions
|
@ -39,12 +39,6 @@ class IconImporter(object):
|
||||||
image, image_file, icon_url = self.fetch_image_from_path(force=self.force)
|
image, image_file, icon_url = self.fetch_image_from_path(force=self.force)
|
||||||
|
|
||||||
if image:
|
if image:
|
||||||
try:
|
|
||||||
ico_image = self.load_icon(image_file)
|
|
||||||
if ico_image: image = ico_image
|
|
||||||
except ValueError:
|
|
||||||
# print "Bad .ICO"
|
|
||||||
pass
|
|
||||||
image = self.normalize_image(image)
|
image = self.normalize_image(image)
|
||||||
try:
|
try:
|
||||||
color = self.determine_dominant_color_in_image(image)
|
color = self.determine_dominant_color_in_image(image)
|
||||||
|
@ -95,6 +89,8 @@ class IconImporter(object):
|
||||||
|
|
||||||
def load_icon(self, image_file, index=None):
|
def load_icon(self, image_file, index=None):
|
||||||
'''
|
'''
|
||||||
|
DEPRECATED
|
||||||
|
|
||||||
Load Windows ICO image.
|
Load Windows ICO image.
|
||||||
|
|
||||||
See http://en.wikipedia.org/w/index.php?oldid=264332061 for file format
|
See http://en.wikipedia.org/w/index.php?oldid=264332061 for file format
|
||||||
|
@ -167,7 +163,7 @@ class IconImporter(object):
|
||||||
string = image_file.read(size)
|
string = image_file.read(size)
|
||||||
mask = Image.frombytes('1', image.size, string, 'raw',
|
mask = Image.frombytes('1', image.size, string, 'raw',
|
||||||
('1;I', stride, -1))
|
('1;I', stride, -1))
|
||||||
|
|
||||||
image = image.convert('RGBA')
|
image = image.convert('RGBA')
|
||||||
image.putalpha(mask)
|
image.putalpha(mask)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue