ID:1350773
 
Resolved
Unused sections of an icon file were filled with random pixels.
BYOND Version:499.1202
Operating System:Windows 7 Ultimate 64-bit
Web Browser:Firefox 23.0
Applies to:DM Language
Status: Resolved (500.1205)

This issue has been resolved.
This bug is back. Not only does it effect DreamSeeker, Dream Maker icons also seem to get messed up. The same test case produces similar results.

//GoodIcon.dmi
<javax_imageio_png_1.0>
<IHDR width="192" height="192" bitDepth="1" colorType="Palette" compressionMethod="deflate" filterMethod="adaptive" interlaceMethod="none"/>
<PLTE>
<PLTEEntry index="0" red="192" green="192" blue="192"/>
<PLTEEntry index="1" red="0" green="0" blue="255"/>
</PLTE>
<tRNS>
<tRNS_Palette>
<tRNS_PaletteEntry index="0" alpha="0"/>
</tRNS_Palette>
</tRNS>
<zTXt>
<zTXtEntry keyword="Description" compressionMethod="deflate" text="# BEGIN DMI
version = 4.0
width = 96
height = 96
state = "1"
dirs = 4
frames = 1
# END DMI
"/>
</zTXt>
</javax_imageio_png_1.0>

//BadIcon.dmi
<javax_imageio_png_1.0>
<IHDR width="192" height="192" bitDepth="2" colorType="Palette" compressionMethod="deflate" filterMethod="adaptive" interlaceMethod="none"/>
<PLTE>
<PLTEEntry index="0" red="0" green="0" blue="0"/>
<PLTEEntry index="1" red="0" green="0" blue="0"/>
<PLTEEntry index="2" red="0" green="0" blue="255"/>
<PLTEEntry index="3" red="0" green="0" blue="0"/>
</PLTE>
<tRNS>
<tRNS_Palette>
<tRNS_PaletteEntry index="0" alpha="0"/>
</tRNS_Palette>
</tRNS>
<zTXt>
<zTXtEntry keyword="Description" compressionMethod="deflate" text="# BEGIN DMI
version = 4.0
width = 96
height = 96
state = "1"
dirs = 4
frames = 1
# END DMI
"/>
</zTXt>
</javax_imageio_png_1.0>
I can't reproduce this. The BadIcon.dmi file is identical to GoodIcon.dmi for me, at least as far as Dream Maker sees them. This happens regardless of whether I create the bad one first, or the good one first. That is, I see no junk data.

The only difference I can detect between the two icons is that while both have had palettes created, BadIcon.dmi contains some extraneous palette entries. Since these don't impact the image integrity at all, I don't consider that part a bug. Is there actual junk showing up in the icon itself anywhere?
Lummox JR changed status to 'Unverified'
Alright, I went and tested this with the latest version (499.1204) which just came out. The bug has to do with the way BYOND arranges its icon_states in a dmi file. When there's empty space which isn't used, BYOND doesn't seem to "clean" it so it ends up getting filled with junk data.

Steps to reproduce the bug:
Open Dream Maker's Icon Editor and create a new icon.
Within that icon, create a new icon_state and scribble a color in it.
Create a second icon_state and scribble a new color in it.
Create a third icon_state and scribble one last new color in it.
Save the icon.

Expected results:
The dmi file should have three tiles with scribbles and one blank tile.

Actual results:
The dmi file has three tiles with scribbles and one tile with junk data.

Workarounds:
After creating the third icon_state and scribbling in it, create a fourth icon_state and leave it blank. The new blank icon state will clear out the junk data and actually lower the dmi's filesize.

Examples:
Here's a pair of icons, one with junk data and one without. They were created using the steps detailed above. The junk icon is 1,701 bytes while the clean icon is 595 bytes.



This is what the junk data looks like if you look at the dmi as a thumbnail in a Windows folder. You can actually see the corruption in the "null" icon_state on the bottom right of junk icon.dmi which only has three icon_states.


This file was last edited, like, 5-6 months ago. Just posting this here to show that it does happen to others.
I have always noticed this, and I do a TON of automated icon creation... Almost every file has junk data in the bottom right hand corner.
In response to FIREking
FIREking wrote:
I have always noticed this.

I just searched through the last year or so worth of icons I've made. Anything that I manually touched up in the DMI editor seems to have this issue. Anything that I've imported directly from paint/photoshop does not seem to have this issue. Particularly, anything I've later resized in the DMI editor, and anything I've ever deleted icons from seems to have this issue.

Particularly, take a look at icons generated using raycropper. Some have it, some don't. My raycropper tool generates icons using 320x240 3D renders from a custom-written blender environment with a series of handwritten pixel shaders.

They are imported in a sequence, then cropped down to specified sizes input in the cropping configuration menu, then exported into a series of about 26 tiling spaces with various dimensions.

https://www.dropbox.com/s/f443ef9tou2e080/ raycropperoutput.zip
Just to clarify as I close this, the original bug that was reported way back was in fact fixed; the problem here is that some bogus pixels were being included in the icon data in unused sections of the .png file. While this wasn't causing any problems that I'm aware of, it would have at least made for bigger files.
Lummox JR resolved issue with message:
Unused sections of an icon file were filled with random pixels.
Victory.