Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JPEGのヘッダーが壊れてしまう問題の修正 #678

Conversation

4ster1sk
Copy link
Contributor

@4ster1sk 4ster1sk commented Nov 12, 2024

Fix: #675
空のExifDataではなくOrientationが回転しない値である1に設定(元のEXIFにOrientationが存在する場合は元の値を使う)

@codecov-commenter
Copy link

codecov-commenter commented Nov 12, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 61.22449% with 19 lines in your changes missing coverage. Please review.

Project coverage is 27.81%. Comparing base (8512cea) to head (6451c97).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...r/note_create_page/note_create_state_notifier.dart 61.22% 19 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #678      +/-   ##
===========================================
+ Coverage    27.73%   27.81%   +0.08%     
===========================================
  Files          312      312              
  Lines        16296    16323      +27     
===========================================
+ Hits          4520     4541      +21     
- Misses       11776    11782       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@4ster1sk 4ster1sk force-pushed the fix/broken-upload-image branch 3 times, most recently from b4e1cd1 to dec0b72 Compare November 13, 2024 08:32
@poppingmoon
Copy link
Contributor

poppingmoon commented Nov 13, 2024

流れを追っていなかったのですが、アップロード時にExifは消去されるのにそれ以前にExifを消去しようとしているのはなぜですか?

ref: #376

if (fileName.endsWith("jpg") ||
fileName.endsWith("jpeg") ||
fileName.endsWith("tiff") ||
fileName.endsWith("tif")) {
imageData =
await FlutterImageCompress.compressWithList(file.data);
}

HEICをアップロードできないようにするためにはJPEGやTIFFと同様にHEICも圧縮するようにすればいいのでloadImageというメソッド自体が不要のように思います

@4ster1sk
Copy link
Contributor Author

うわー。ほんとだ。まったくこの箇所読んでなかった…。

しかしflutter_image_compress、
WindowsとLinux非対応なため圧縮処理すり抜けてアップロードされてしまうのでは…?

またHEIC対応がiOS/Androidだけなうえ、ブラウザで表示することができないので
Android/iOSに限って対応した上で拡張子をjpgに変える必要がありそう。

@poppingmoon
Copy link
Contributor

圧縮された画像はJPEGになるのでブラウザでの表示は問題ないと思います
https://pub.dev/documentation/flutter_image_compress/latest/flutter_image_compress/FlutterImageCompress/compressWithList.html

WindowsとLinuxに非対応なのはそうですが、いずれにせよもう少し単純にできると思います(アップロードの直前の部分でMimeTypeを確認してはねるとか)

@4ster1sk 4ster1sk force-pushed the fix/broken-upload-image branch from dec0b72 to e834fa4 Compare November 13, 2024 22:09
@4ster1sk 4ster1sk force-pushed the fix/broken-upload-image branch from e834fa4 to f5335c4 Compare November 13, 2024 22:19
@shiosyakeyakini-info
Copy link
Owner

🙇🙇🙇🙇🙇🙇🙇🙇

@shiosyakeyakini-info shiosyakeyakini-info merged commit 32f648a into shiosyakeyakini-info:develop Nov 17, 2024
1 check passed
@4ster1sk 4ster1sk deleted the fix/broken-upload-image branch November 17, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[iOS?]0kBのJPEGが添付される
4 participants