Error in Tycho while replacing the product ico files
Asked Answered
B

4

3

We are using tycho v0.13 and maven 3.0 for building our product.
We get the following error/warning when building

Error - 7 icon not replaced in C:\Users\AppData\Local\Temp\p2.brandingIron7115583353836584113\launcher.exe using D:\Builds\workspace\plugins\icons\app-icon.ico

the ico files are all proper. as a result window icons are being replaced by the standard eclipse icons.

Boarer answered 12/6, 2012 at 15:0 Comment(1)
I've done it with Tycho 0.19.0 and Andrews answer (https://mcmap.net/q/1623291/-error-in-tycho-while-replacing-the-product-ico-files). Important: The images may not be compressed in the ICOHypocaust
D
6

I'm not overly familiar with Tycho itself, but here I believe it is using the branding code that ships with p2 (and which originally came from PDE/Build).

The code extracts the icon images from the originating launcher executable and searchs for matching images in the provided ico file. If an image is found that matches the size and bit-depth exactly, then that image is replaced. There are 7 images embedded in the launcher and the provided ico should provide images that match those in size and bit-depth.

The error message indicates that 7 of the icons found in the executable did not have matching sizes/bit-depths in the provided ico file.

The launcher that shipped in 3.7.2 contains the following sizes (order does not matter):

  • 48x48 8 bit (256 colors)
  • 32x32 8 bit
  • 24x24 8 bit
  • 16x16 8 bit
  • 48x48 32 bit (RGB + Alpha)
  • 32x32 32 bit
  • 16x16 32 bit

The launcher that is shipping in 4.2 (3.8) contains the following sizes:

  • 256x256, 32 bit (RGB / Alpha Channel)
  • 48x48, 32 bit (RGB / Alpha Channel)
  • 32x32, 32 bit (RGB / Alpha Channel)
  • 16x16, 32 bit (RGB / Alpha Channel)
  • 48x48, 8 bit (256 colors)
  • 32x32, 8 bit (256 colors)
  • 16x16, 8 bit (256 colors)
Dickey answered 12/6, 2012 at 15:46 Comment(0)
E
6

We had some frustrating moments where we got the error about missing icons, so I decided to dig into it. Below are my findings… basically adding extra information to Andrew Niefer's answer.

For Windows, the process of replacing the images in the native launcher is described below. The processing is done by p2 class: org.eclipse.pde.internal.swt.tools.IconExe

This class looks at the resources of native launcher and notes the bitmaps that are in there: their sizes and their color depth. Then it looks at the provided images. This can be a list of separate BPMs or an ICO file containing multiple BMPs. Their sizes and color depths are also noted. This only works when all provided images are uncompressed. When one or more of the images is compressed, the process stops and no bitmaps are replaced in the native launcher. Next it tries to match the provided BMP sizes and color depths to the ones in the native launcher and where they match, they are replaced in the native launcher. When one or more bitmaps in the native launcher are not available in the provided images, the following message is written to System.err:

Error - <n> icon(s) not replaced in […]using […]

The class IconExe has a main method and can be run as stand-alone. Its first argument is the native launcher that needs to be modified and the following arguments are the provided BPM or ICO files.

For Eclipse 4.3(.x), the native launcher contains 7 bitmaps:

  • 256x256, 32 bit (RGB / Alpha Channel)
  • 48x48, 32 bit (RGB / Alpha Channel)
  • 32x32, 32 bit (RGB / Alpha Channel)
  • 16x16, 32 bit (RGB / Alpha Channel)
  • 48x48, 8 bit (256 colors)
  • 32x32, 8 bit (256 colors)
  • 16x16, 8 bit (256 colors)

So, for the process of replacing the images to be successful, 7 images with the same size and depth need to be provided, either as separate BMPs or inside an ICO.

However, when using the tycho-p2-publisher-plugin, you cannot provide 7 separate BPMs, since the tycho-p2-publisher-plugin is not aware of the 256x256x32 image when it is specified in the .product file. Its class org.eclipse.tycho.model.Launcher only reads the other 6 image locations from the .product file and hence, the 7th image (the 256x256x32 one) is skipped. Therefore, the list that IconExe gets is one image short and will always report:

Error - 1 icon(s) not replaced in […]using […]

The solution that worked for us was to combine the 7 BMPs into one ICO file and provide that in the .product file.

But note that some image manipulation applications, that can create ICO files, tend to compress the 256x256x32 image by default. This is what got us on the wrong foot! So be careful that all images in the ICO file are uncompressed.

Exedra answered 2/5, 2014 at 9:20 Comment(1)
However, when using the tycho-p2-publisher-plugin... - This was a bug in Tycho, but the bug has been fixed in 0.21.0.Crouse
G
1

I had a similar problems with 3.7.2 when my ICO file contained

  1. higher resolution images such as 512x512
  2. some images were compressed.

I deleted the unused layers from my ICO file using Gimp.

Gaullism answered 13/6, 2012 at 10:41 Comment(0)
I
1

Just to add to previous answers:

  1. All of the images in the .ico file should be BMP format, not PNG. I've seen at least two utilities that wanted to use the PNG format for one or more of the images.

  2. If you are targeting Eclipse 4.2 then you will have to wait for Tycho 0.16.0 (or use the SNAPSHOT version already available) to get a version that includes the latest IconExe that copes with 256x256 bitmaps. If your .ico file contains one of these then it causes a read error in the old IconExe and none of your icons get replaced (and you get the error as seen in the opening message). See https://bugs.eclipse.org/bugs/show_bug.cgi?id=384509.

Internist answered 6/8, 2012 at 15:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.