패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.5.2

flutter_exif_rotation

일부 장치에서 가로 방향으로 촬영한 사진의 방향을 수정하는 Flutter 플러그인입니다.

AndroidiOS
30일 다운로드
4.8만
좋아요
96
Pub 점수
150

패키지 설치

flutter pub add flutter_exif_rotation

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

특정 장치가 가로 모드로 사진을 촬영할 때 발생하는 이미지 방향 문제를 자동으로 수정하는 플러터 플러그인입니다. 이미지에서 EXIF 메타데이터를 읽어 올바른 회전 각도를 결정하고 적용하여 수동 조정 없이 이미지를 올바르게 표시합니다. 사용자 업로드 사진을 처리하는 앱에서는 방향 일관성이 중요한 경우에 특히 유용합니다. 이 플러그인은 안드로이드 및 iOS 플랫폼을 모두 지원하며 기존 이미지 처리 워크플로우에 원활하게 통합됩니다.

사용 사례

  • 모바일 카메라에서 나온 회전된 이미지 수정
  • 갤러리에서 이미지 표시의 일관성 보장
  • 사진 방향 보정 자동화
  • 사진 업로드 기능의 사용자 경험 향상
  • 장치 카메라에서 이미지를 직접 처리

주요 기능

  • EXIF 방향 데이터 읽기
  • 메타데이터를 기반으로 이미지를 자동으로 회전합니다
  • Android 및 iOS를 지원합니다
  • 경량이며 통합이 쉬움
  • 원본 이미지 품질을 유지합니다

적합한 대상

  • 이미지 갤러리 애플리케이션
  • 사진 공유 플랫폼
  • 카메라 통합 앱
  • 정확한 이미지 렌더링이 필요한 앱
  • 자동 방향 수정이 필요한 개발자

고려 사항

  • 이미지 파일 액세스 권한 필요
  • 모든 이미지 형식과 호환되지 않을 수 있습니다
  • EXIF 데이터의 존재에 따라 다릅니다
  • 방향 보정만 가능
  • 이미지 파일 이외에는 적합하지 않습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Fix exif rotation for flutter

pub package

Flutter plugin that fixes the picture orientation for some devices. In some devices the exif data shows picture in landscape mode when they're actually in portrait. This plugin fixes the orientation for pictures taken with those devices.

Every version of Android is supported. iOS implemented by @Bhagatcliffex and currently supported

Android

Add this in your AndroidManifest.xml (you don't need these permissions in case when you manipulate files from internal storage only (file are stored inside the app's directory ( /data/data/{your package}/ )) )

Example
import 'dart:async';
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_exif_rotation/flutter_exif_rotation.dart';
import 'package:image_picker/image_picker.dart';

void main() => runApp(MyApp());

/// The stateful widget
class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

/// The class with the scaffold
class _MyAppState extends State<MyApp> {
  File _image;
  final picker = ImagePicker();

  Future getImage() async {
    final image = await picker.getImage(source: ImageSource.gallery);
    if (image != null && image.path != null) {
      File rotatedImage =
          await FlutterExifRotation.rotateImage(path: image.path);

      if (image != null) {
        setState(() {
          _image = rotatedImage;
        });
      }
    }
  }

  Future getImageAndSave() async {
    final image = await picker.getImage(source: ImageSource.gallery);
    if (image != null && image.path != null) {
      File rotatedImage =
          await FlutterExifRotation.rotateAndSaveImage(path: image.path);

      if (image != null) {
        setState(() {
          _image = rotatedImage;
        });
      }
    }
  }

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Exif flutter rotation image example app'),
        ),
        body: new Center(
          child: _image == null
              ? new Text('No image selected.')
              : new Image.file(_image),
        ),
        persistentFooterButtons: <Widget>[
          new FloatingActionButton(
            onPressed: getImageAndSave,
            tooltip: 'Pick Image and save',
            child: new Icon(Icons.save),
          ),
          new FloatingActionButton(
            onPressed: getImage,
            tooltip: 'Pick Image without saving',
            child: new Icon(Icons.add),
          ),
        ],
      ),
    );
  }
}

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.