我有一組圖像具有損壞的exif方向數據。我想用imagemagick改變這些圖像的方向。我發現了以下命令mogrify -set "%[EXIF:Orientation]" BottomRight image.jpg
,但是當我使用Identify -verbose image.jpg
檢查圖像時,它的方向數據未定義似乎不起作用。使用imagemagick設置圖像方向exif數據
0
A
回答
1
不知道是否/如何可以做到這一點與ImageMagick的,但你可能會想用exiftool如下:
# Set orientation with exiftool
exiftool -Orientation=3 -n input.jpg
1 image files updated
# Check with **ImageMagick**
identify -verbose input.jpg | grep rient
Orientation: BottomRight
exif:Orientation: 3
這裏是一個小循環測試所有8個值:
for x in {1..8}; do
exiftool -Orientation=$x -n input.jpg > /dev/null
identify -verbose input.jpg | grep Orientation
done
Orientation: TopLeft
exif:Orientation: 1
Orientation: TopRight
exif:Orientation: 2
Orientation: BottomRight
exif:Orientation: 3
Orientation: BottomLeft
exif:Orientation: 4
Orientation: LeftTop
exif:Orientation: 5
Orientation: RightTop
exif:Orientation: 6
Orientation: RightBottom
exif:Orientation: 7
Orientation: LeftBottom
exif:Orientation: 8
1
隨着imagemagick你可以按照以下方式做到這一點。
mogrify -orient <orientation> *.jpg
有效取向
bottom-left
right-top
bottom-right
top-left
left-bottom
top-right
left-top
undefined
right-bottom
更多信息here。
您可以使用識別來驗證你的變化
identify -verbose input.jpg | grep orientation
相關問題
- 1. ImageMagick:根據EXIF方向獲取圖像大小
- 2. 無法使用ImageMagick設置圖像方向
- 3. iPhone AVFoundation圖像EXIF方向
- 4. 使用PHP設置EXIF數據
- 5. 如何使用exif方向數據自動旋轉圖像使用php
- 6. 我可以使用imageMagick從圖像中獲取IPTC和EXIF數據嗎?
- 7. Codeigniter strip圖像EXIF數據
- 8. ImageMagick的不根據EXIF
- 9. 設置圖像的方向
- 10. 使用iphone-exif EXIF數據
- 11. 使用EXIF或光標圖像的方向始終爲0
- 12. 使用ImageMagick檢測圖片方向
- 13. 使用ImageMagick將EXIF數據提取爲文本
- 14. 從Base-64編碼圖像獲取Exif圖像方向太慢
- 15. 如何在使用DKImagePickerController時使用exif數據獲取圖像?
- 16. ImageMagick - 爲灰度圖像設置水平
- 17. 在Imagemagick中設置圖像質量
- 18. Android:旋轉位圖一次或使用EXIF方向旋轉圖像視圖
- 19. 如何處理不符合EXIF方向數據的Android設備?
- 20. 圖像的exif數據代碼
- 21. 從圖像中剝離EXIF數據
- 22. 存儲圖像EXIF mata數據dictonary
- 23. 將EXIF數據添加到圖像
- 24. 閱讀黑莓圖像的EXIF數據
- 25. 圖像元數據MediaStore與EXIF
- 26. 如何應用EXIF方向的圖像作爲網址android
- 27. 使用imagemagick設置質量?
- 28. 設置圖像方向的問題
- 29. 如何設置相機圖像方向?
- 30. 使用EXIF數據檢索DJI無人機的圖像