Skip to content

bump version#52

Merged
CaiJingLong merged 2 commits intomainfrom
fix-async-jpeg
Aug 6, 2025
Merged

bump version#52
CaiJingLong merged 2 commits intomainfrom
fix-async-jpeg

Conversation

@CaiJingLong
Copy link
Copy Markdown
Member

No description provided.

…n JPEG decoder

Signed-off-by: Caijinglong <cjl_spy@163.com>
Copilot AI review requested due to automatic review settings August 6, 2025 06:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue with async JPEG image processing by removing incorrect orientation data retrieval and adds comprehensive test coverage for async image processing functionality.

  • Removes a line that incorrectly attempts to read orientation data from the wrong position in JPEG decoder
  • Adds comprehensive test suite for async image processing methods covering multiple image formats
  • Updates version to 2.4.1 and documents the fix in changelog

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/image_size_getter/lib/src/decoder/impl/jpeg_decoder.dart Removes incorrect orientation byte reading that was causing async JPEG processing issues
packages/image_size_getter/test/image_size_getter_test.dart Adds comprehensive test coverage for async image processing methods across multiple formats
packages/image_size_getter/pubspec.yaml Bumps version to 2.4.1
packages/image_size_getter/CHANGELOG.md Documents the JPEG orientation fix
Comments suppressed due to low confidence (1)

packages/image_size_getter/lib/src/decoder/impl/jpeg_decoder.dart:95

  • The removal of this line fixes a bug where orientation data was being read from an incorrect offset (start + 9) in the JPEG structure. This was likely causing incorrect orientation values or potential out-of-bounds reads in async JPEG processing.
        return _getSize(widthList, heightList, orientation);


test('Test getSizeAsync with unsupported format', () async {
// Create a temporary file with unsupported content
final tempFile = File('../../example/asset/temp_unsupported.txt');
Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test creates temporary files in the asset directory which could cause issues if tests run concurrently or fail unexpectedly. Consider using a system temp directory or test-specific directory to avoid potential conflicts with existing asset files.

Suggested change
final tempFile = File('../../example/asset/temp_unsupported.txt');
final tempFile = File('${Directory.systemTemp.path}/temp_unsupported_${DateTime.now().microsecondsSinceEpoch}.txt');

Copilot uses AI. Check for mistakes.

test('Test getSizeResultAsync with unsupported format', () async {
// Create a temporary file with unsupported content
final tempFile = File('../../example/asset/temp_unsupported2.txt');
Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the previous test, this creates a temporary file in the asset directory. Consider using a system temp directory or test-specific directory to avoid potential conflicts with existing asset files.

Suggested change
final tempFile = File('../../example/asset/temp_unsupported2.txt');
final tempFile = File('${Directory.systemTemp.path}/temp_unsupported2.txt');

Copilot uses AI. Check for mistakes.
@CaiJingLong CaiJingLong changed the title Fix async jpeg bump version Aug 6, 2025
@CaiJingLong CaiJingLong merged commit 41dd12b into main Aug 6, 2025
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants