Closed EternalDeiwos closed 2 years ago
Let's see if we can get this worked out. I'm not sure how the original path is included in the bio and I'm curious if the bio is being changed after each of the commands you included above. Can post a comment below with more about the problem?
Thanks!
It appears in the bio as HTML, after running those commands above it looks like this:
<img src="worlds/idrotfm/characters/reghed-shaman/Reghed Shaman-bio-1.png" />
I'm not precisely sure but before running those commands it looked something like this:
<img src="worlds/idrotfm/characters/224_-_Reghed_Shaman/Reghed Shaman-bio-1.png" />
The relative paths (.
) in the commands above resolve to the world root folder /.../worlds/idroftm
such that it would contain /.../worlds/idroftm/world.json
.
FWT was enclosing the string replacements in quote marks by default, which didn't match the paths in the escaped HTML of the bio.value attribute. I've disabled that behavior and run the following test:
foundry@b195a18ce418:/data/Data/worlds/cor-idrotfm$ fwt download --type actors --asset-dir characters .
foundry@b195a18ce418:/data/Data/worlds/cor-idrotfm$ grep -i -o -E '<img[^>]+Reghed[^>]+>' data/actors.db
<img src=\"worlds/cor-idrotfm/characters/224_-_Reghed_Shaman/Reghed Shaman-bio-1.png\">
foundry@b195a18ce418:/data/Data/worlds/cor-idrotfm$ ls -l characters/224_-_Reghed_Shaman/
total 598
-rw-rw-r--+ 1 foundry foundry 463662 Oct 9 08:13 'Reghed Shaman-bio-1.png'
-rw-rw-r--+ 1 foundry foundry 66190 Oct 9 08:10 avatar.webp
-rw-rw-r--+ 1 foundry foundry 66190 Oct 9 08:10 token.webp
foundry@b195a18ce418:/data/Data/worlds/cor-idrotfm$ cwebp -preset drawing -sharp_yuv -mt -psnr 45 "characters/224_-_Reghed_Shaman/Reghed Shaman-bio-1.png" -o "characters/224_-_Reghed_Shaman/Reghed Shaman-bio-1.webp"
foundry@b195a18ce418:/data/Data/worlds/cor-idrotfm$ fwt --logfile=/tmp/fwt_dedup.log dedup --ext=".png" --ext=".webp" --byname --preferred=".*webp" .
foundry@b195a18ce418:/data/Data/worlds/cor-idrotfm$ grep -i -o -E '<img[^>]+Reghed[^>]+>' data/actors.db
<img src=\"worlds/cor-idrotfm/characters/224_-_Reghed_Shaman/Reghed Shaman-bio-1.webp\">
foundry@b195a18ce418:/data/Data/worlds/cor-idrotfm$ fwt --logfile=/tmp/fwt_renameall.log renameall --remove="[0-9]{3}_-_" --replace="/_+/-/" --lower .
foundry@b195a18ce418:/data/Data/worlds/cor-idrotfm$ grep -i -o -E '<img[^>]+Reghed[^>]+>' data/actors.db
<img src=\"worlds/cor-idrotfm/characters/reghed-shaman/reghed shaman-bio-1.webp\">
Please update FWT and attempt to dedup and rename again.
Confirmed working. Thanks @nathan-sain
As per title.
For example, I have a path that looks like this:
characters/reghed-shaman/Reghed Shaman-bio-1.png
after running:The result should be:
characters/reghed-shaman/reghed-shaman-bio-1.webp