Merge pull request #5 from koji-1009/feat/publish

Prepare publish
This commit is contained in:
Koji Wakamiya 2025-12-08 21:41:31 +09:00 committed by GitHub
commit af1e08e53c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
23 changed files with 102 additions and 58 deletions

View File

@ -1,6 +1,6 @@
# image_ffi
# platform_image_converter
A high-performance Flutter plugin for cross-platform image format conversion using native APIs.
A high-performance Flutter plugin for cross-platform image format conversion using native APIs on iOS, macOS, Android, and Web.
## Features
@ -26,17 +26,17 @@ A high-performance Flutter plugin for cross-platform image format conversion usi
### Installation
Add `image_ffi` to your `pubspec.yaml`:
Add `platform_image_converter` to your `pubspec.yaml`:
```yaml
dependencies:
image_ffi: ^0.0.1
platform_image_converter: ^0.0.1
```
### Basic Usage
```dart
import 'package:image_ffi/image_ffi.dart';
import 'package:platform_image_converter/platform_image_converter.dart';
import 'dart:typed_data';
// Convert HEIC image to JPEG
@ -58,6 +58,7 @@ final pngData = await ImageConverter.convert(
### Input Formats
- **iOS/macOS**: JPEG, PNG, HEIC, WebP, BMP, GIF, TIFF, and more
- **Android**: JPEG, PNG, WebP, GIF, BMP, HEIC (via BitmapFactory)
- **Web**: JPEG, PNG, WebP, GIF, BMP (via Canvas API)
### Output Formats
The supported output formats are defined by the `OutputFormat` enum, with platform-specific limitations:

View File

@ -1,6 +1,6 @@
# image_ffi_example
# platform_image_converter_example
Demonstrates how to use the image_ffi plugin.
Demonstrates how to use the platform_image_converter plugin.
## Getting Started

View File

@ -6,7 +6,7 @@ plugins {
}
android {
namespace = "com.example.image_ffi_example"
namespace = "com.example.platform_image_converter_example"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
@ -21,7 +21,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.example.image_ffi_example"
applicationId = "com.example.platform_image_converter_example"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion

View File

@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="image_ffi_example"
android:label="platform_image_converter_example"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity

View File

@ -1,4 +1,4 @@
package com.example.image_ffi_example
package com.example.platform_image_converter_example
import io.flutter.embedding.android.FlutterActivity

View File

@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"

View File

@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"

43
example/ios/Podfile Normal file
View File

@ -0,0 +1,43 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '13.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end

View File

@ -378,7 +378,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.imageFfiExample;
PRODUCT_BUNDLE_IDENTIFIER = com.example.platformImageConverterExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
@ -394,7 +394,7 @@
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.imageFfiExample.RunnerTests;
PRODUCT_BUNDLE_IDENTIFIER = com.example.platformImageConverterExample.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@ -411,7 +411,7 @@
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.imageFfiExample.RunnerTests;
PRODUCT_BUNDLE_IDENTIFIER = com.example.platformImageConverterExample.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
@ -426,7 +426,7 @@
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.imageFfiExample.RunnerTests;
PRODUCT_BUNDLE_IDENTIFIER = com.example.platformImageConverterExample.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
@ -557,7 +557,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.imageFfiExample;
PRODUCT_BUNDLE_IDENTIFIER = com.example.platformImageConverterExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@ -579,7 +579,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.imageFfiExample;
PRODUCT_BUNDLE_IDENTIFIER = com.example.platformImageConverterExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;

View File

@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Image Ffi Example</string>
<string>Platform Image Converter Example</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
@ -13,7 +13,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>image_ffi_example</string>
<string>platform_image_converter_example</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>

View File

@ -1,8 +1,8 @@
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:image_ffi/image_ffi.dart';
import 'package:image_picker/image_picker.dart';
import 'package:platform_image_converter/platform_image_converter.dart';
void main() {
runApp(const MainApp());
@ -78,7 +78,7 @@ class _MainPageState extends State<MainPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('image_ffi Demo')),
appBar: AppBar(title: const Text('platform_image_converter Demo')),
body: SingleChildScrollView(
padding: const .all(16),
child: Column(

View File

@ -192,13 +192,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.1.2"
image_ffi:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "0.0.1"
image_picker:
dependency: "direct main"
description:
@ -375,6 +368,13 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.9.1"
platform_image_converter:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "0.0.1"
plugin_platform_interface:
dependency: transitive
description:

View File

@ -1,5 +1,5 @@
name: image_ffi_example
description: "Demonstrates how to use the image_ffi plugin."
name: platform_image_converter_example
description: "Demonstrates how to use the platform_image_converter plugin."
publish_to: 'none'
version: 1.0.0+1
@ -11,7 +11,7 @@ dependencies:
flutter:
sdk: flutter
image_ffi:
platform_image_converter:
path: ../
image_picker:
@ -22,5 +22,3 @@ dev_dependencies:
flutter:
uses-material-design: true
config:
enable-swift-package-manager: true

View File

@ -23,13 +23,13 @@
<!-- iOS meta tags & icons -->
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="image_ffi_example">
<meta name="apple-mobile-web-app-title" content="platform_image_converter_example">
<link rel="apple-touch-icon" href="icons/Icon-192.png">
<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>
<title>image_ffi_example</title>
<title>platform_image_converter_example</title>
<link rel="manifest" href="manifest.json">
</head>
<body>

View File

@ -1,6 +1,6 @@
{
"name": "image_ffi_example",
"short_name": "image_ffi_example",
"name": "platform_image_converter_example",
"short_name": "platform_image_converter_example",
"start_url": ".",
"display": "standalone",
"background_color": "#0175C2",

View File

@ -3,11 +3,11 @@ library;
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:image_ffi/src/image_converter_platform_interface.dart';
import 'package:image_ffi/src/output_format.dart';
import 'package:image_ffi/src/android/shared.dart';
import 'package:image_ffi/src/darwin/shared.dart';
import 'package:image_ffi/src/web/shared.dart';
import 'package:platform_image_converter/src/android/shared.dart';
import 'package:platform_image_converter/src/darwin/shared.dart';
import 'package:platform_image_converter/src/image_converter_platform_interface.dart';
import 'package:platform_image_converter/src/output_format.dart';
import 'package:platform_image_converter/src/web/shared.dart';
export 'src/output_format.dart';

View File

@ -1,9 +1,9 @@
import 'dart:typed_data';
import 'package:image_ffi/gen/jnigen_bindings.dart';
import 'package:image_ffi/src/image_converter_platform_interface.dart';
import 'package:image_ffi/src/output_format.dart';
import 'package:jni/jni.dart';
import 'package:platform_image_converter/gen/jnigen_bindings.dart';
import 'package:platform_image_converter/src/image_converter_platform_interface.dart';
import 'package:platform_image_converter/src/output_format.dart';
/// Android image converter using BitmapFactory and Bitmap compression.
///

View File

@ -1,7 +1,7 @@
import 'dart:typed_data';
import 'package:image_ffi/src/image_converter_platform_interface.dart';
import 'package:image_ffi/src/output_format.dart';
import 'package:platform_image_converter/src/image_converter_platform_interface.dart';
import 'package:platform_image_converter/src/output_format.dart';
final class ImageConverterAndroid implements ImageConverterPlatform {
const ImageConverterAndroid();

View File

@ -2,10 +2,10 @@ import 'dart:ffi';
import 'dart:typed_data';
import 'package:ffi/ffi.dart';
import 'package:image_ffi/gen/darwin_bindings.dart';
import 'package:image_ffi/src/image_converter_platform_interface.dart';
import 'package:image_ffi/src/output_format.dart';
import 'package:objective_c/objective_c.dart';
import 'package:platform_image_converter/gen/darwin_bindings.dart';
import 'package:platform_image_converter/src/image_converter_platform_interface.dart';
import 'package:platform_image_converter/src/output_format.dart';
/// iOS/macOS image converter using ImageIO framework.
///

View File

@ -1,7 +1,7 @@
import 'dart:typed_data';
import 'package:image_ffi/src/image_converter_platform_interface.dart';
import 'package:image_ffi/src/output_format.dart';
import 'package:platform_image_converter/src/image_converter_platform_interface.dart';
import 'package:platform_image_converter/src/output_format.dart';
final class ImageConverterDarwin implements ImageConverterPlatform {
const ImageConverterDarwin();

View File

@ -1,7 +1,7 @@
import 'dart:typed_data';
import 'package:image_ffi/src/image_converter_platform_interface.dart';
import 'package:image_ffi/src/output_format.dart';
import 'package:platform_image_converter/src/image_converter_platform_interface.dart';
import 'package:platform_image_converter/src/output_format.dart';
final class ImageConverterWeb implements ImageConverterPlatform {
const ImageConverterWeb();

View File

@ -2,8 +2,8 @@ import 'dart:async';
import 'dart:js_interop';
import 'dart:typed_data';
import 'package:image_ffi/src/image_converter_platform_interface.dart';
import 'package:image_ffi/src/output_format.dart';
import 'package:platform_image_converter/src/image_converter_platform_interface.dart';
import 'package:platform_image_converter/src/output_format.dart';
import 'package:web/web.dart';
/// Web image converter using Canvas API.

View File

@ -1,7 +1,7 @@
name: image_ffi
name: platform_image_converter
description: "A high-performance Flutter plugin for cross-platform image format conversion using native APIs."
version: 0.0.1
homepage: https://github.com/koji-1009/image_ffi
homepage: https://github.com/koji-1009/platform_image_converter
environment:
sdk: ^3.10.0