Skip to content

Commit

Permalink
Fix JPEG detection code
Browse files Browse the repository at this point in the history
  • Loading branch information
OrthoCube committed Jul 26, 2023
1 parent f8fdd3f commit c5d6c44
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/screens/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class _HomeScreenState extends State<HomeScreen> {
_files.addAll(
foundFiles.where(filenameExtensionIsImage).map((f) {
final String extension =
getFileExtension(f) == 'jpg' ? 'jpeg' : 'jpeg';
getFileExtension(f) == 'jpg' ? 'jpeg' : getFileExtension(f);
return ImageFile(
name: basename(f.path),
path: f.path,
Expand Down
6 changes: 4 additions & 2 deletions lib/tools/tools.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ Future<ProcessResult> doConvert(
? ['-j', '0']
: ['-j', '1'];

final ProcessResult result = await Process.run('cjxl', [
final List<String> arguments = [
sourcePath,
outPath,
...losslessJpeg,
...distance,
]);
];

final ProcessResult result = await Process.run('cjxl', arguments);

if (result.exitCode == 0) {
final File inFile = File(sourcePath);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 0.3.0+1
version: 0.3.1+1

environment:
sdk: '>=3.0.6 <4.0.0'
Expand Down

0 comments on commit c5d6c44

Please sign in to comment.