Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jasonkhanlar opened this issue Jan 6, 2021 · 3 comments

Comments

@jasonkhanlar
Copy link

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

@ronoaldo
Copy link

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

@SmallJoker
Copy link
Member

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.

@ronoaldo
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants