Flutter - Apple ProRaw photo orientation

54 views Asked by At

I'm trying to show a photo taken on an iphone in ProRaw (DNG) format in a flutter application. The problem is that if the photo is taken keeping the phone vertically on the flutter application it will be rotated horizontally.

Original orientation:

Flutter Application:

Source Code:

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
 

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Image.asset('assets/IMG_0210.DNG'),
      )
    );
  }
}

The problem occurs on all platforms. Other apps display ProRaw images correctly. I also tried to convert the image to png or jpg (via flutter image package) but the image is still flipped.

0

There are 0 answers