2020-04-18 11:49 AM
hi,
slowly slowly i've got my growing TouchGFX project to become too fat for the2MB flash on a STM32F429..
as i've put too much graphic assets on the "database" and i'm not using all of them in the screens, i'm wondering if there's a way to find out "programmatically" which assets are not really referenced.. ( i know which "few" icons i put up with a routine..)
i only found this thread, 4 year old, that's really shows a manual procedure (and tedious..)
https://touchgfx.zendesk.com/hc/en-us/community/posts/207462585-Removing-unused-bitmap
thanx for hints!
Solved! Go to Solution.
2020-04-20 01:10 AM
There's no "tool" to do this if you're having a hard time getting an overview of unused assets, but if i have time i could write a script for you. Should be easy to do if you want to do it yourself. Hints:
/Martin
2020-04-20 01:10 AM
There's no "tool" to do this if you're having a hard time getting an overview of unused assets, but if i have time i could write a script for you. Should be easy to do if you want to do it yourself. Hints:
/Martin
2020-04-20 01:56 AM
Here's some dirty Ruby-pseudo-code to get you started:
found = false
unused = []
pngs = Dir["assets/images/*.png"].collect {|a| "BITMAP_" + File.basename(a, ".png").upcase + "_ID" }
Dir["**/*View*.cpp"].each { |f|
pngs.each { |p|
found = true if File.open(f).grep(/p/)
}
unused << p if !found
found = false
}
2020-04-20 07:51 AM
than again Martin for the fast and constructive reply.. i'll try to make up something next days and report!
2020-04-20 08:00 AM
Sweet! Let me know how you do :)