skinsdb icon indicating copy to clipboard operation
skinsdb copied to clipboard

Generated preview doesn't recognize 128x128 resolution images, only 64x64

Open jasonkhanlar opened this issue 4 years ago • 3 comments

64x64 resolution skins generated preview looks fine, but not for 128x128

jasonkhanlar avatar Jan 06 '21 00:01 jasonkhanlar

I noticed that too. Is it possible to add support for it in the next release?

ronoaldo avatar Mar 16 '21 10:03 ronoaldo

Possible fix by downscaling the images:

diff --git a/skin_meta_api.lua b/skin_meta_api.lua
index 1ce04ed..a6e7fc5 100644
--- a/skin_meta_api.lua
+++ b/skin_meta_api.lua
@@ -94,7 +94,12 @@ function skin_class:get_preview()
                return self._preview
        end
 
-       local player_skin = "("..self:get_texture()..")"
+       local player_skin
+       if self:get_meta("format") == "1.8" then
+               player_skin = "\\("..self:get_texture().."\\^\\[resize\\:64x64\\)"
+       else
+               player_skin = "\\("..self:get_texture().."\\^\\[resize\\:64x32\\)"
+       end
        local skin = ""
 
        -- Consistent on both sizes:

Feedback is welcome.

SmallJoker avatar Sep 06 '23 15:09 SmallJoker

Since this is for the preview, looks like a clean way to fix it. I'll test as soon as I have a chance on a local world.

ronoaldo avatar Sep 10 '23 04:09 ronoaldo