Duplicate Files Created

Hello,

I'm working to reduce the file size of my Hype projects for web apps. Apple doesn't seem to mind the larger app files but Android has a 150mb limit if you don't want to jump too many hurdles. I noticed that within my Hype project, there are several copies of png files for example. I'm wondering if there is a way to reference the same file instead of separate instances or copies of the files being generated? Maybe this is how it is designed but if I could just reference one file, it would greatly reduce my project size?

In the image, I have pointed out two scenes each having two layouts using a similar png file of "CatieSide-Sad". Any suggestions on how to reduce the amount of png files or is this by design? Thanks!

As comparison, I looked at my Jigsaw template. It only uses the one image... even though it's copied 16 times. I'm not sure how you did that.

What happens if you use the "Choose" option to select the original image?

If I was in a rush, not having the time to solve this normally, I'd just manually place the images in regular "Rectangle" elements...

<img src="${resourcesFolderName}/image.png" />

2 Likes

Hype is designed to identify duplicates when inserting new images and if a duplicate is discovered, it will use the original and not add a new resource.

There's a chance those aren't duplicates or slightly different - on some I see a 3.1 MB vs 4.5 MB file size. I'd be curious as to how you did the import and/or what your workflow might be about those files (they came from different paths, they were optimize later, etc.)

I believe there may be a couple outstanding edge cases where dupes can be created (it may have to do with undo or symbol import; I couldn't immediately find the bug in our tracker), so I'm guessing you may have hit that. If you're able to reliably reproduce this, please let me know your steps.

The easiest way to unduplicate images would be to select the element and hit the "Choose" button for the Background Image in the element inspector. Then when you select one in the Finder, it will be associated with one that already exists. There's not an easy way to say which it would be of the duplicates, but as long as "Remove when no longer refernced" is checked, at some point the dupe will go away.

If there's a lot of duplicates and this will take you more than ~5 min or so, feel free to send a zip of the document to support@tumult.com. We could probably write a script to identify and unduplicate the images fairly quickly.

2 Likes

Thanks for your help. I tried to replace the files and made sure the check box for remove when no longer referenced was selected (it already was BTW). This appears to be happening for multiple file types.

Here is a link to my dropbox project (300+MB): https://www.dropbox.com/s/27ciqu2we6nb9rc/LCC-Hype-ver2%20.hype.zip?dl=0

Project Resource contents:

Thanks - I'll shoot you a DM with a cleaned up version.

I've made a basic tool which can identify and clean up duplicates. If anyone else has documents with duplicated assets, feel free to send them to support at tumult dot com (dropbox links okay) and I'd be happy to deduplicate as part of testing this code. (Also if there are specific steps you've found that cause duplicated assets, please let me know!)

So I looked at the project contents of the "LCC-Hype-ver2" file I received back and noticed some dup files still exist. Here is an example..
Screen Shot 2020-12-01 at 10.35.31 AM

Thanks - I was able to find a few ways to be more thorough when searching for duplicates and the new method catches those specific files.

(I'll DM you the new file.)

1 Like