Homec4science

Fix calculation of spritesheet hashes to use relative paths

Authored by epriestley <git@epriestley.com> on May 18 2013, 19:33.

Description

Fix calculation of spritesheet hashes to use relative paths

Summary:
When a user generates sprites, we hash all the inputs to figure out what we actually need to regenerate. Normally (i.e., on my machine), this works fine.

However, part of the hash is the absolute path of all the input images, so my machine hashes in /Users/epriestley/phabricator/path/to/sprite.png, and then @chad regens them and gets a hash of /Users/notchad/phabricator/path/to/sprite.png instead, or whatever. The hash comes out different so every manifest and sheet gets regenerated.

Instead, hash the relative path -- e.g., path/to/sprite.png. This keeps the path the same across machines and means that only sprites which have actually changed will regenerate.

See also next diff.

Test Plan:

  • Before this patch: generated sprites in phabricator/, then moved phabricator/ to phabricator2/ and regenerated. Incorrectly, all sprites were regenerated. - After this patch: generated sprites in phabricator/, then moved phabricator/ to phabricator2/ and regenerated. Nothing was regenerated.

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D5964

Details

Committed
epriestley <git@epriestley.com>May 18 2013, 19:33
Pushed
aubortMar 17 2017, 12:03
Parents
rPHU02aba1305210: Move PhutilArray constructor one level up
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHU3e07dbde7d46: Fix calculation of spritesheet hashes to use relative paths (authored by epriestley <git@epriestley.com>).May 18 2013, 19:33