Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
|
45f5238f45 | ||
|
e5efa1e4f8 |
|
@ -7,12 +7,12 @@ if ! [ -f "$1" ]; then
|
|||
exit 1;
|
||||
fi
|
||||
|
||||
json=$(magick convert "$1" JSON:-)
|
||||
json=$(magick convert "$1[0]" JSON:-)
|
||||
|
||||
width=$(echo $json | jq '.[0].image.geometry.width')
|
||||
height=$(echo $json | jq '.[0].image.geometry.height')
|
||||
|
||||
magick convert "$1" RGBA:- | \
|
||||
magick convert "$1[0]" RGBA:- | \
|
||||
cargo r --example stdin --release -- \
|
||||
--width $width \
|
||||
--height $height
|
||||
|
|
|
@ -358,11 +358,11 @@ impl Encoder {
|
|||
}
|
||||
}
|
||||
|
||||
let mut blurhash = String::with_capacity(30);
|
||||
|
||||
let (_, dc) = self.factors[0];
|
||||
let ac = &self.factors[1..];
|
||||
|
||||
let mut blurhash = String::with_capacity(1 + 1 + 4 + 2 * ac.len());
|
||||
|
||||
let size_flag = self.components.x - 1 + (self.components.y - 1) * 9;
|
||||
base83::encode(size_flag, 1, &mut blurhash);
|
||||
|
||||
|
|
Loading…
Reference in a new issue