Skip to content

Commit

Permalink
3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ojii committed Aug 13, 2024
1 parent 5ce760e commit 8fdccb6
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
push:
branches:
- main
- master
tags:
- '*'
pull_request:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Test
on: push
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
Expand Down
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "imgsize"
version = "3.0.0"
version = "3.0.1"
edition = "2021"

[lib]
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,10 @@ The following must be run in a virtual env:
pip install '.[test]'
pytest python-tests
```

## Release

1. Change the version number in `Cargo.toml`
2. Push to the main branch on GitHub (preferably via Pull Request)
3. Create a Release (git tag) on GitHub
4. Release will automatically be pushed to PyPI
15 changes: 8 additions & 7 deletions src/gif.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ pub fn get_size(data: &[u8]) -> Option<Size> {
let width = cursor.read_u16::<LittleEndian>()?;
let height = cursor.read_u16::<LittleEndian>()?;
let gtc_flag = cursor.read_u8()?;
let gce_offset = 0xd + if gtc_flag & (1 << 7) != 0 {
// Ref : https://www.w3.org/Graphics/GIF/spec-gif89a.txt
// 3 x 2^(Size of Global Color Table+1)
(1 << ((gtc_flag & 0x07) + 1)) * 3
} else {
0
};
let gce_offset = 0xd
+ if gtc_flag & (1 << 7) != 0 {
// Ref : https://www.w3.org/Graphics/GIF/spec-gif89a.txt
// 3 x 2^(Size of Global Color Table+1)
(1 << ((gtc_flag & 0x07) + 1)) * 3
} else {
0
};
cursor.seek(SeekFrom::Start(gce_offset))?;
let animated = if cursor.read_u8()? == 0x21 {
cursor.seek(SeekFrom::Start(gce_offset + 3))?;
Expand Down

0 comments on commit 8fdccb6

Please sign in to comment.