Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ scripts:
exec: flutter pub get
test:
exec: flutter test
packageFilters:
dirExists: test
format:
exec: dart format --set-exit-if-changed .
try_build_apk:
Expand Down
5 changes: 5 additions & 0 deletions packages/flutter_image_compress/example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ build/
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*

# Flutter iOS ephemeral (generated by toolchain)
**/ios/Flutter/ephemeral/
**/ios/Flutter/ephemeral/flutter_lldb_helper.py
**/ios/Flutter/ephemeral/flutter_lldbinit

# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
<string>13.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion packages/flutter_image_compress/example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '12.0'
platform :ios, '13.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -216,6 +216,7 @@
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand Down Expand Up @@ -269,7 +270,6 @@
"${BUILT_PRODUCTS_DIR}/SDWebImageWebPCoder/SDWebImageWebPCoder.framework",
"${BUILT_PRODUCTS_DIR}/flutter_image_compress_common/flutter_image_compress_common.framework",
"${BUILT_PRODUCTS_DIR}/libwebp/libwebp.framework",
"${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
Expand All @@ -278,7 +278,6 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImageWebPCoder.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_image_compress_common.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libwebp.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down Expand Up @@ -365,7 +364,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -412,7 +411,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
Expand All @@ -46,11 +47,13 @@
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ class _MyAppState extends State<MyApp> {
}

/// The example for compressing heic format.
///
///
/// Convert jpeg to heic format, and then convert heic to jpg format.
///
///
/// Show the file path and size in the console.
void _compressHeicExample() async {
print('start compress');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import FlutterMacOS
import Foundation

import flutter_image_compress_macos
import path_provider_foundation

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FlutterImageCompressMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterImageCompressMacosPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
}
15 changes: 10 additions & 5 deletions packages/flutter_image_compress/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ version: 1.0.0+1
publish_to: none

environment:
sdk: '>=2.19.0 <3.0.0'
# Flutter now uses Dart 3; keep this example compatible with current toolchains.
sdk: '>=3.0.0 <4.0.0'
flutter: '>=2.0.0'

dependencies:
Expand All @@ -16,10 +17,14 @@ dependencies:
# flutter_image_compress_web:
# path: ../../flutter_image_compress_web
path_provider: ^2.0.0
path_provider_ohos:
git:
url: https://gitee.com/openharmony-sig/flutter_packages.git
path: packages/path_provider/path_provider_ohos

# NOTE: The OHOS implementation lives in a separate repo and is intentionally
# not pulled in by default to keep `flutter pub get` and CI analysis offline-friendly.
# If you need OHOS in the example, add `path_provider_ohos` back locally.
# path_provider_ohos:
# git:
# url: https://gitee.com/openharmony-sig/flutter_packages.git
# path: packages/path_provider/path_provider_ohos
flutter:
uses-material-design: true

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//
// SYMetadata.h
// SYPictureMetadataExample
//
// Created by Stan Chevallier on 12/13/12.
// Copyright (c) 2012 Syan. All rights reserved.
//

#import <Foundation/Foundation.h>

// Forward declare to reduce header coupling; Photos is imported in SYMetadata.m.
@class PHAsset;

#import "SYMetadataTIFF.h"
#import "SYMetadataGIF.h"
#import "SYMetadataJFIF.h"
Expand All @@ -26,11 +26,6 @@
#import "SYMetadataDNG.h"
#import "SYMetadataExifAux.h"

// http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/index.html
// http://www.exiv2.org/tags.html

@class ALAsset;

@interface SYMetadata : SYMetadataBase

@property SYMETADATA_PROPERTY_COPY NSDictionary *originalDictionary;
Expand All @@ -54,7 +49,8 @@
@property SYMETADATA_PROPERTY_STRONG SYMetadataDNG *metadataDNG;
@property SYMETADATA_PROPERTY_STRONG SYMetadataExifAux *metadataExifAux;

// we don't know how to parse those, so we juste give access to them
// Fallback
Copy link

Copilot AI Oct 20, 2025

Choose a reason for hiding this comment

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

The comment 'Fallback' is vague compared to the original explanation. Consider clarifying intent (e.g., 'Unparsed vendor-specific dictionaries exposed as-is for consumers').

Suggested change
// Fallback
// Unparsed vendor-specific dictionaries exposed as-is for consumers (fallback for unknown or proprietary metadata)

Copilot uses AI. Check for mistakes.
// Unparsed vendor-specific dictionaries exposed as-is for consumers (fallback for unknown/proprietary metadata).
@property SYMETADATA_PROPERTY_COPY NSDictionary *metadataApple;
@property SYMETADATA_PROPERTY_COPY NSDictionary *metadataPictureStyle;

Expand All @@ -72,12 +68,27 @@
@property (nonatomic, copy, readonly) NSString *profileName;

+ (instancetype)metadataWithDictionary:(NSDictionary *)dictionary;
+ (instancetype)metadataWithAsset:(ALAsset *)asset __TVOS_PROHIBITED;
+ (instancetype)metadataWithAssetURL:(NSURL *)assetURL __TVOS_PROHIBITED;

/// Photos-framework based metadata extraction.
+ (instancetype)metadataWithPHAsset:(PHAsset *)asset;

/// Deprecated legacy API (ALAsset-era). Prefer `metadataWithPHAsset:`.
///
/// This keeps source compatibility with older versions of this library without
/// referencing the removed AssetsLibrary framework types.
+ (instancetype)metadataWithAsset:(id)asset __attribute__((deprecated("Use metadataWithPHAsset: instead.")));

/// Deprecated legacy API (ALAsset URL-era). Prefer `metadataWithPHAsset:`.
+ (instancetype)metadataWithAssetURL:(NSURL *)assetURL __attribute__((deprecated("Use metadataWithPHAsset: instead.")));

+ (instancetype)metadataWithFileURL:(NSURL *)fileURL;
+ (instancetype)metadataWithImageData:(NSData *)imageData;

+ (NSDictionary *)dictionaryWithAssetURL:(NSURL *)assetURL __TVOS_PROHIBITED;
/// Photos-framework based metadata dictionary extraction.
+ (NSDictionary *)dictionaryWithPHAsset:(PHAsset *)asset;

/// Deprecated legacy API (ALAsset URL-era). Prefer `dictionaryWithPHAsset:`.
+ (NSDictionary *)dictionaryWithAssetURL:(NSURL *)assetURL __attribute__((deprecated("Use dictionaryWithPHAsset: instead.")));

Copy link

Copilot AI Oct 20, 2025

Choose a reason for hiding this comment

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

This renames/removes previously public APIs (+metadataWithAsset: and +dictionaryWithAssetURL:), creating a breaking change contrary to the PR description. To preserve source compatibility, consider reintroducing a deprecated wrapper for +dictionaryWithAssetURL: that fetches a PHAsset via Photos (e.g., using [PHAsset fetchAssetsWithALAssetURLs:options:]) and forwards to +dictionaryWithPHAsset:. If you intentionally drop ALAsset support, please note it clearly as a breaking change.

Suggested change
// Deprecated: Use dictionaryWithPHAsset: instead. This wrapper fetches PHAsset from ALAsset URL.
+ (NSDictionary *)dictionaryWithAssetURL:(NSURL *)assetURL __attribute__((deprecated("Use dictionaryWithPHAsset: instead.")));

Copilot uses AI. Check for mistakes.
+ (NSData *)dataWithImageData:(NSData *)imageData andMetadata:(SYMetadata *)metadata;

Expand Down
Loading
Loading