Closed Laulajatar closed 3 years ago
Hi! I can reproduce that on Linux:
But Windows can preview and open that exact file (copied from Linux) just fine:
I'm not very familiar with Linux, but the image file created by Mono's Texture2D.SaveAsPng
method might be slightly invalid in a way that Linux can't handle but Windows can?
It's also replicate-able on my Ubuntu system, however the file CAN be opened via Glimpse/GIMP image editor. PNGCheck at least marks Cursors.jpg as a valid file. Got an interesting error when recompressing the file with OptiPNG though:
When running optipng Cursors.png
:
** Processing: Cursors.png
Warning: Not enough image data
704x2256 pixels, 4x8 bits/pixel, RGB+alpha
Recoverable errors found in input. Rerun OptiPNG with -fix enabled.
Error: Previous error(s) not fixed
** Status report
1 file(s) have been processed.
1 error(s) have been encountered.
When running optipng Cursors.png -fix
:
** Processing: Cursors.png
Warning: Not enough image data
704x2256 pixels, 4x8 bits/pixel, RGB+alpha
Recoverable errors found in input. Fixing...
Input IDAT size = 491520 bytes
Input file size = 491573 bytes
Trying:
zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 333154
Selecting parameters:
zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 333154
Output IDAT size = 333154 bytes (158366 bytes decrease)
Output file size = 333211 bytes (158362 bytes = 32.22% decrease)
** Status report
1 file(s) have been processed.
1 error(s) have been encountered.
1 erroneous file(s) have been fixed.
The file produced by optipng Cursors.png -fix
can be opened as expected.
So it may be an error with how the file is being built/compressed in Linux?
There's a similar error here that indicates the issue may be with the adler-32 value, which would cause issues with zlib compression: https://stackoverflow.com/questions/36070759/a-palette-base-png-with-idat-that-has-btype-00-for-no-compression-now-with-adle
Unfortunately I don't have much knowledge about Linux myself, I just play games and try not to break too much.
In GIMP, I noticed that the images open, but they have all the same error:
The last line repeats a previous line of pixels. When run through optipng *.png -fix, this line is instead empty. Since I can open the russian cursors, which isn't broken, I can see how it should look like.
Top image is Russian one, which is correct. Middle image is broken one opened in GIMP, which repeats pixels from a previous line. Bottom one is broken one, run through optipng.
I tried opening the corrupted images in my Windows 7 VM. The windows image preview and paint are able to open it, but are also missing the bottom line of the image. My (very old) Photoshop version isn't able to open it.
Looks to me like the image is just literally missing data, and some programs just show what's there, while others refuse to try.
A MacOS user on Discord reported the same problem. They were able to open a file exported on Windows fine, so it does seem like an issue with the export itself through Mono.
These files were affected for them:
TileSheets/furniture
(and all language variants);Fonts/Korean_05
, 07
, and 08
;Fonts/SmallFont.ko-KR
;LooseSprites/Cursors
(and all language variants except Russian);LooseSprites/JunimoNote
(and all language variants);Maps/SebastianMountainTiles
;Tilesheets/Craftables
.These files are affected for me, which is mostly the same ones:
Fonts/Chinese_0
Fonts/Korean_00, 05, 07, 08
Fonts/SmallFont.ko-KR
LooseSprites/JunimoNote
(all languages)LooseSprites/Cursors
(all but Russian)Maps/{{season}}_island_tilesheet_1
(all seasons)Maps/sebastianMountainTiles
Tilesheets/Craftables
TileSheets/furniture
(all languages)I dug out some old version of XNB node now and extracted the ones I needed in a Windows 7 VM.
This seems to be the MonoGame bug discussed here and fixed in MonoGame 3.8, which is newer than the version used by the game. The workaround is to use a separate library like StbImageWriteSharp for saving images (on Linux/MacOS only).
Hello! Just reporting that I'm experiencing the same issue on MacOS. I haven't checked all the PNGs, but these are the ones I noticed were corrupted for me:
Tilesheets/Craftables
TileSheets/furniture
(all languages)Fixed in StardewXnbHack 1.0.5 with the migration to MonoGame 3.8 and .NET 5. Thanks for reporting it!
I just tried using this to unpack game files on Manjaro Linux, using StardewXnbHack 1.0.3. It looks successful, but some of the PNGs can't be opened, especially larger ones. For example, all furniture tilesheets are corrupt, all Cursors except for Cursors.ru-RU.png, all JunimoNotes, also all *_island_tilesheet_1.
Tried opening the files in Krita, qview and gpicview but they seem broken. [SMAPI] SMAPI 3.8.0 with Stardew Valley 1.5.0 on Unix 5.8.18.1