From 0d497664252a75482c120f2aa4588833f53e46a5 Mon Sep 17 00:00:00 2001 From: Ishotihadus Date: Sat, 3 Feb 2018 11:25:04 +0900 Subject: [PATCH] fix etc2rgba8 decoding bug --- lib/mikunyan/decoders/image_decoder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mikunyan/decoders/image_decoder.rb b/lib/mikunyan/decoders/image_decoder.rb index fe31de3..26986a8 100644 --- a/lib/mikunyan/decoders/image_decoder.rb +++ b/lib/mikunyan/decoders/image_decoder.rb @@ -599,7 +599,7 @@ module Mikunyan base = bin >> 56 mult = bin >> 52 & 0xf table = Etc2AlphaModTable[bin >> 48 & 0xf] - (0...16).map{|i| (base + table[bin >> i*3 & 7] * mult).clamp(0, 255).chr} + (0...16).reverse_each.map{|i| (base + table[bin >> i*3 & 7] * mult).clamp(0, 255).chr} end end