[Wesnoth-dev] Duplicate image files in trunk

2007-04-25 Thread Eric S. Raymond
Wiith the NR merge coming up, I decided to give macroscope the
capability to find and detect cliques of duplicate files, so I
can drop redundant copies of images in NR.

You can generate this report by going to data/tools and typing

make collisions

My code uses MD5 hashing rather than byte-by-byte comparison, so 
this works pretty fast.

Here's a copy of the current report.  I deduce from this, for example,
that it ought to be possible to remove the file
data/campaigns/The_South_Guard/images/misc/cross.png.

%%
../../images/terrain/castle/elven/keep-wall-0-ne.png
../../images/terrain/castle/elven/keep-inside-ne.png
../../images/terrain/castle/elven/keep-wall-1-ne.png
../../images/terrain/castle/elven/keep-wall-ne.png
%%
../../images/terrain/cave/wall-rough-chasm-convex-nw.png
../../images/terrain/cave/wall-rough-convex-nw.png
%%
../../images/projectiles/wailprojectile-n-6.png
../../images/projectiles/wailprojectile-s-6.png
%%
../../images/terrain/castle/sunkenkeep-keep-e.png
../../images/terrain/castle/sunken-ruinkeep1-keep-e.png
%%
../../images/terrain/castle/encampment-concave-w.png
../../images/terrain/castle/encampment-convex-w.png
%%
../../images/projectiles/wailprojectile-n-4.png
../../images/projectiles/wailprojectile-s-4.png
%%
../../data/tutorial/images/units/elder-mage-ranged1.png
../../data/campaigns/Heir_To_The_Throne/images/units/elder-mage-ranged1.png
%%
../../data/tutorial/images/units/elder-mage-defend.png
../../data/campaigns/Heir_To_The_Throne/images/units/elder-mage-defend.png
%%
../../images/terrain/castle/sunkenkeep-inside-sw.png
../../images/terrain/castle/sunkenkeep-wall-sw.png
%%
../../data/tutorial/images/units/elder-mage-ranged3.png
../../data/campaigns/Heir_To_The_Throne/images/units/elder-mage-ranged3.png
%%
../../data/tutorial/images/units/human-princess-attack-1.png
../../data/campaigns/Heir_To_The_Throne/images/units/human-princess-attack-1.png
%%
../../images/terrain/castle/keep-wall-1-ne.png
../../images/terrain/castle/keep-wall-0-ne.png
../../images/terrain/castle/keep-inside-ne.png
../../images/terrain/castle/keep-wall-ne.png
%%
../../data/campaigns/Under_the_Burning_Suns/external_binary_data/images/UtBS_campaign_icon.png
../../data/campaigns/Under_the_Burning_Suns/images/newelves/kaleh.png
%%
../../data/campaigns/The_Rise_Of_Wesnoth/images/units/undead-vampirelady-defend.png
../../data/campaigns/The_Rise_Of_Wesnoth/images/units/undead-vampirelady-range.png
%%
../../images/terrain/castle/sunkenkeep-wall-1-nw.png
../../images/terrain/castle/sunkenkeep-wall-nw.png
../../images/terrain/castle/sunkenkeep-wall-0-nw.png
../../images/terrain/castle/sunkenkeep-inside-nw.png
%%
../../images/misc/bar-energy-enemy.png
../../images/misc/bar-energy.png
%%
../../data/campaigns/Heir_To_The_Throne/images/story/story9.png
../../data/campaigns/The_Rise_Of_Wesnoth/images/story/rough_landing.png
%%
../../images/terrain/castle/sunkenkeep-wall-0-ne.png
../../images/terrain/castle/sunkenkeep-inside-ne.png
../../images/terrain/castle/sunkenkeep-wall-1-ne.png
../../images/terrain/castle/sunkenkeep-wall-ne.png
%%
../../images/buttons/paste_button_editor-active.png
../../images/buttons/paste_button_editor.png
../../images/buttons/paste_button_editor-pressed.png
%%
../../data/campaigns/Eastern_Invasion/external_binary_data/images/EI_campaign_image.png
../../data/campaigns/Eastern_Invasion/images/portraits/gweddry.png
%%
../../images/terrain/castle/encampment-convex-se.png
../../images/terrain/castle/encampment-concave-se.png
%%
../../data/campaigns/Under_the_Burning_Suns/images/newelves/desert-elvish-archer+female-defend.png
../../data/campaigns/Under_the_Burning_Suns/images/newelves/desert-elvish-archer-defend.png
%%
../../data/campaigns/Under_the_Burning_Suns/external_binary_data/images/UtBS_difficulty_hard.png
../../data/campaigns/Under_the_Burning_Suns/images/newelves/desert-elvish-prowler.png
%%
../../images/terrain/lava-dcastle-ccw-nw.png
../../images/terrain/lava-dcastle-chasm-ccw-nw.png
%%
../../images/units/human-magi/white-mage+female-die-4.png
../../images/units/human-magi/white-mage-die-4.png
%%
../../images/buttons/group_castle-active.png
../../images/buttons/group_castle-active-pressed.png
%%
../../data/campaigns/Under_the_Burning_Suns/images/newelves/desert-elvish-sharpshooter-defend.png
../../data/campaigns/Under_the_Burning_Suns/images/newelves/desert-elvish-sharpshooter+female-defend.png
%%
../../data/tutorial/images/portraits/lisar.png
../../data/campaigns/Heir_To_The_Throne/images/portraits/lisar.png
%%
../../images/items/bones.png
../../data/campaigns/Under_the_Burning_Suns/images/items/bones.png
%%
../../data/tutorial/images/units/human-princess-defend.png
../../data/campaigns/Heir_To_The_Throne/images/units/human-princess-defend.png
%%
../../images/terrain/castle/sunkenkeep-keep-se.png
../../images/terrain/castle/sunken-ruinkeep1-keep-se.png
%%
../../data/campaigns/Under_the_Burning_Suns/external_binary_data/images/UtBS_difficulty_challenging.png
../../data/campaigns/Und

Re: [Wesnoth-dev] Duplicate image files in trunk

2007-04-26 Thread Benoit Timbert
Selon "Eric S. Raymond" <[EMAIL PROTECTED]>:

> Wiith the NR merge coming up, I decided to give macroscope the
> capability to find and detect cliques of duplicate files, so I
> can drop redundant copies of images in NR.
>
> You can generate this report by going to data/tools and typing
>
> make collisions
>
> My code uses MD5 hashing rather than byte-by-byte comparison, so
> this works pretty fast.
>
> Here's a copy of the current report.  I deduce from this, for example,
> that it ought to be possible to remove the file
> data/campaigns/The_South_Guard/images/misc/cross.png.
>

AFAIK there a few images where duplication is necessary.

Thing like this :
> ../../data/tutorial/images/units/elder-mage-ranged1.png
> ../../data/campaigns/Heir_To_The_Throne/images/units/elder-mage-ranged1.png

These are images for campaign-specific units.
Mainline campaigns are expected to be packagable alone (just like user
campaigns), without dependancies, that is why when a campaign-specific unit is
used in more than one campaign, it is duplicated.


And things like this :
>
../../data/campaigns/Under_the_Burning_Suns/external_binary_data/images/UtBS_campaign_icon.png
> ../../data/campaigns/Under_the_Burning_Suns/images/newelves/kaleh.png

Campaign specific images are usually packaged inside a #ifdef to avoid to
pollute content for other campaign, thus they are only available within the
campaign.
By the way, a few content like icons for the campaign selection must be shared
(ie outside of the #ifdef), this is the purpose of that
external_binary_data/images directory (through this path might be different is
some campaigns).
Often, this content is portait or unit frames thus is also found in the normal
image directory. It is more convenient for scripts and artist to find all the
graphics like frames and portaits in the same tree; that is the main reason why
there is duplication in external_binary_data/

___
Wesnoth-dev mailing list
Wesnoth-dev@gna.org
https://mail.gna.org/listinfo/wesnoth-dev