ID:1115925
 
Resolved
Inserting a frame from one icon into another could cause bogus results in some cases.
BYOND Version:498
Operating System:Windows 7 Ultimate 64-bit
Web Browser:Firefox 17.0
Applies to:Dream Seeker
Status: Resolved (499)

This issue has been resolved.
Descriptive Problem Summary:
Splicing together icons at runtime seems to have problems when leaving certain frames/directions empty.

Numbered Steps to Reproduce Problem:
Take a frame from an existing icon and insert it into another icon for one to three directions, leaving the unused directions alone.

https://dl.dropbox.com/u/9855840/icon%20bug_src.zip

Expected Results:
There should be a new icon with one new frame from the other icon while the rest of the directions are blank.

Actual Results:
The copied frames will be correct, but every unused frame will be filled with junk data. If the copied frames are part of an animation they will lose their delay setting, defaulting to 1.

Does the problem occur:
Every time? Yes
In other user accounts? Yes
On other computers? Yes

Workarounds:
Blank out each unused direction manually.
I ran GoodIcon.dmi and BadIcon.dmi through this tool to view its metadata, and it seems some things are missing:

// 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="8" colorType="RGBAlpha" compressionMethod="deflate" filterMethod="adaptive" interlaceMethod="none"/>
<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>
This bug is making life extremely difficult. Please fix it.
Lummox JR resolved issue with message:
Inserting a frame from one icon into another could cause bogus results in some cases.
i wub u
Yes!
Something very similar to this bug happens in Dream Maker when copy/pasting frames. I can't get it to duplicate reliably, but it usually seems to happen when I start with an icon then copy/paste frames over the pre-existing icon_states.

[Edit] Did a little testing, the junk data effects the file size.

Opening the icon in Dream Maker then saving it with a different name seemed to remove the junk data and reduce the file size.