From 9196581fa00e34b9e8c8fbda3d06003e7b053020 Mon Sep 17 00:00:00 2001 From: jmcmullan Date: Fri, 24 Aug 2012 20:11:26 +0000 Subject: [PATCH] icon.library: Only use a FACE tag's Width and Height if the IFF also have imagery This fixes the issue where icons that specified their Aspect in the FACE tag, but had no imagery, and used Width=-1, Height=-1, ended up as 256x256 icons. Signed-off-by: Jason S. McMullan git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@45646 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- workbench/libs/icon/diskobj35io.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/workbench/libs/icon/diskobj35io.c b/workbench/libs/icon/diskobj35io.c index 48479d8c85..6d6d5528a9 100644 --- a/workbench/libs/icon/diskobj35io.c +++ b/workbench/libs/icon/diskobj35io.c @@ -552,11 +552,16 @@ BOOL ReadIcon35(struct NativeIcon *icon, struct Hook *streamhook, } /* if ((iff = AllocIFF())) */ + /* Only use the Width and Height fields of a FACE section + * if it also contains image data. + */ if (have_face) { - icon->ni_Face.Width = fc.Width + 1; - icon->ni_Face.Height = fc.Height + 1; - //icon->icon35.flags = fc.Flags; - icon->ni_Face.Aspect = fc.Aspect; + if (have_argb1 || have_argb2 || have_imag1 || have_imag2) { + icon->ni_Face.Width = fc.Width + 1; + icon->ni_Face.Height = fc.Height + 1; + } + //icon->icon35.flags = fc.Flags; + icon->ni_Face.Aspect = fc.Aspect; } if (have_argb1) -- 2.11.4.GIT