-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loading image to project file can cause mismatched file type #8387
Comments
The problem here is actually that the project icon files are JPEG files, which does not match the .png file extension the files use. The Windows Icon Updater works correctly if given PNG files, but it does not support using JPEG files (IIRC because Windows doesn't support JPEG data for icons). To work around this you can save to a project folder, use an external image editor like Paint.NET to load the icon files and save-as in PNG format, and then copy those files over the existing icon files in the project folder. The real question is why you'd end up with JPEG files with the .png file extension, and I think this relates to a change in r409 (Animations editor: imported lossy images are now preserved in their original format in the project until modified). It is by design that if you do something like import a JPEG file for a Sprite animation frame, Construct keeps that animation frame's file in JPEG format, and only converts it to PNG if you edit it. However it looks like this is inappropriately applied to project files like icons - presumably you edited the icon in Construct and imported a JPEG image, and Construct used the JPEG file data in place of a file with a .png file extension, which is incorrect - in this case it should maintain the encoding of the file extension. So assigning to @DiegoScirra to fix - steps to reproduce are:
To check the real encoding format, open the image in Notepad (or some other text editor). PNG images include the characters "PNG" in the first few bytes; JPEG images include "JFIF" in the first few bytes. In general, editing an image from a project file must preserve the encoding according to the file extension - e.g. if you open a .webp project file and import a PNG, it should also save the data as WebP, etc. |
Thank you @AshleyScirra ! For information, and it only hit me after your post, how i created these icons are I have a .jpg image that i used an automated webservice (https://www.appicon.co/#app-icon) to create the different sizes. it seems like that site converted them to the faulty .pngs. I opened all icons in photoshop and quickly re-exported them as png's and now it works. I hope that information helps. |
Problem description
Construct does not update icons at all after importing new icons, setting them to app icon, exporting to nwjs/webview and using the windowsiconupdater.
Attach a .c3p
icon test.zip
Steps to reproduce
open, export and run icon .exe.
Observed result
it removes default icon in case of nwjs and nothing with webview, although it gives the correct confirmationo.
Expected result
Change icon.
More details
Personally I need this fixed urgently since we are submitting for steam NextFest in february. I only use Stables and no betas for safety.
Affected browsers/platforms:
Using latest Stable.
The text was updated successfully, but these errors were encountered: