ID:2199163
 
Resolved
Client-side icon operations handled some icons improperly, causing unexpected behavior when a source icon was not already in the cache.
BYOND Version:510
Operating System:Windows 10 Home
Web Browser:Chrome 55.0.2883.87
Applies to:Dream Seeker
Status: Resolved (511.1370)

This issue has been resolved.
Descriptive Problem Summary:
When scaling images that are not in the RSC file by default, the Scale function for the icon datum will not function correctly the first time a user logs into the server. The first time when a user (so when they download the image file from the server, it will not scale correctly but instead crop from the top left. To fix this, a player must relog and it seems to fix itself. This can only be replicated if a user clears their cache.

Numbered Steps to Reproduce Problem:

Code Snippet (if applicable) to Reproduce Problem:
var/icon/T = icon("maxresdefault.jpg") //image or directory does not matter
var/obj/B = new //to set the new rescaled image too.
T.Scale(60,120) //This can be set to anything and the same problem will produce.
B.icon = T
B.loc = usr.loc //Shows the result.


Expected Results:
The image scales to the requested size stated in the code on the first login and first download of the resource.

Actual Results:
The image instead of scaling, scales to the request size but instead of scaling the image, only crops to that size from the top left.

Does the problem occur:
Every time? Or how often? Just the first time the resource is downloaded to the client's machine.
In other games? Not that I know of.
In other user accounts? Yes.
On other computers? Yes.

When does the problem NOT occur?
I've not yet found a way that the problem doesn't occur so I cannot be much help here. The only way for the problem not to occur is if the dmb is launched in Dream Seeker first.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked?
This problem is present in previous versions of BYOND. The problem still persisted at 500.1205

Workarounds:
Relogging seems to be the only way to fix this issue.


https://drive.google.com/ open?id=0B_tggsDW3UCndVlkdXJPVEhNcVE
Do you have a quick demo project for this?
https://drive.google.com/ open?id=0B_tggsDW3UCndVlkdXJPVEhNcVE

EDIT: So in my recent attempts to fix this bug, I discovered that it had something to do with the cache and preload_rsc variable. I changed it and it had no effect but the problem only persisted after I cleared my cache.
Problem: You forgot that because your .jpg isn't in the resources, it wouldn't get included in your zip. Your demo is incomplete.
Okay, will fix! :)

EDIT: Here is the new source. Added 1 file. https://drive.google.com/ open?id=0B_tggsDW3UCnLVNsQUVOWWFtYzQ
bump
Ah, sorry, I've been distracted by a couple of other issues and haven't gotten to this yet. I'll check on it soon.
Lummox JR resolved issue with message:
Client-side icon operations handled some icons improperly, causing unexpected behavior when a source icon was not already in the cache.
Thank you for checking out this bug :)