Pino Toscano
2015-May-29 14:01 UTC
[Libguestfs] [PATCH] inspection: lift size limit for RHEL icons
In RHEL-based distros, the provided icons have (obviously) different sizes than the RHEL ones, used in icon_rhel as reference. Since 100K should be a reasonable threshold for avoid keeping a per-distro list of limits, just use it as only size limit. --- src/inspect-icon.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/inspect-icon.c b/src/inspect-icon.c index fb998c2..c83ba13 100644 --- a/src/inspect-icon.c +++ b/src/inspect-icon.c @@ -318,24 +318,21 @@ icon_fedora (guestfs_h *g, struct inspect_fs *fs, size_t *size_r) * * Conveniently the RHEL clones also have the same file with the * same name, but containing their own logos. Sense prevails! + * + * Use a generic 100K limit for all the images, as logos in the + * RHEL clones have different sizes. */ static char * icon_rhel (guestfs_h *g, struct inspect_fs *fs, size_t *size_r) { - size_t max_size = 0; const char *shadowman; - if (fs->major_version >= 5 && fs->major_version <= 6) - max_size = 17000; - else - max_size = 66000; - if (fs->major_version <= 6) shadowman = "/usr/share/pixmaps/redhat/shadowman-transparent.png"; else shadowman = "/usr/share/pixmaps/fedora-logo-sprite.png"; - return get_png (g, fs, shadowman, size_r, max_size); + return get_png (g, fs, shadowman, size_r, 102400); } #define DEBIAN_ICON "/usr/share/pixmaps/debian-logo.png" -- 2.1.0
Richard W.M. Jones
2015-Jun-02 14:13 UTC
Re: [Libguestfs] [PATCH] inspection: lift size limit for RHEL icons
On Fri, May 29, 2015 at 04:01:25PM +0200, Pino Toscano wrote:> In RHEL-based distros, the provided icons have (obviously) different > sizes than the RHEL ones, used in icon_rhel as reference. > > Since 100K should be a reasonable threshold for avoid keeping a > per-distro list of limits, just use it as only size limit. > --- > src/inspect-icon.c | 11 ++++------- > 1 file changed, 4 insertions(+), 7 deletions(-) > > diff --git a/src/inspect-icon.c b/src/inspect-icon.c > index fb998c2..c83ba13 100644 > --- a/src/inspect-icon.c > +++ b/src/inspect-icon.c > @@ -318,24 +318,21 @@ icon_fedora (guestfs_h *g, struct inspect_fs *fs, size_t *size_r) > * > * Conveniently the RHEL clones also have the same file with the > * same name, but containing their own logos. Sense prevails! > + * > + * Use a generic 100K limit for all the images, as logos in the > + * RHEL clones have different sizes. > */ > static char * > icon_rhel (guestfs_h *g, struct inspect_fs *fs, size_t *size_r) > { > - size_t max_size = 0; > const char *shadowman; > > - if (fs->major_version >= 5 && fs->major_version <= 6) > - max_size = 17000; > - else > - max_size = 66000; > - > if (fs->major_version <= 6) > shadowman = "/usr/share/pixmaps/redhat/shadowman-transparent.png"; > else > shadowman = "/usr/share/pixmaps/fedora-logo-sprite.png"; > > - return get_png (g, fs, shadowman, size_r, max_size); > + return get_png (g, fs, shadowman, size_r, 102400); > } > > #define DEBIAN_ICON "/usr/share/pixmaps/debian-logo.png"ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Maybe Matching Threads
- [PATCH] inspect: fix icon of RHEL
- [PATCH 1/9] Partially fix --disable-erlang
- [PATCH 1/2] inspection: Find Ubuntu logo from an alternate location (RHBZ#1352761).
- [PATCH 2/2] inspect: switch to version struct for os major/minor version
- [PATCH] inspect: get icon of Gentoo guests