E.g. to copy every 4th byte from binary in_file to out_file:
xxd -p -c4 in_file | sed 's/\(.\{6\}\)\(..\)/\2/g' | xxd -p -r >out_file
xxd -p -c4 in_file | sed 's/\(.\{6\}\)\(..\)/\2/g' | xxd -p -r >out_file
exiftool -H -G:0:1 -Orientation IMG_6071.JPG
[EXIF:IFD0] 0x0112 Orientation : Horizontal (normal)
exiftool -H -G:0:1 -*Orientation IMG_6071.JPG
[EXIF:IFD0] 0x0112 Orientation : Horizontal (normal)
[MakerNotes:Canon] 0x0030 Camera Orientation : Rotate 270 CW
exiftool -H -G:0:1 -*Orientation# IMG_6071.JPG
[EXIF:IFD0] 0x0112 Orientation : 1
[MakerNotes:Canon] 0x0030 Camera Orientation : 2
exiftool -Orientation#=8 IMG_6071.JPG
exiftool -CameraOrientation#=0 IMG_6071.JPG
#!/bin/bash
orientation=$(exiftool -p '${Orientation#} ${CameraOrientation#}' "$1")
orient_array=($orientation)
if [ ${orient_array[0]} -eq 1 ] ; then
if [ ${orient_array[1]} -eq 1 ] ; then
echo "$1 - Camera Orientation - Rotate 90 CW - will be moved to EXIF Orientation";
# also reset Camera Orientation
exiftool -Orientation#=6 -CameraOrientation#=0 -overwrite_original $1
elif [ ${orient_array[1]} -eq 2 ] ; then
echo "$1 - Camera Orientation - Rotate 270 CW - will be moved to EXIF Orientation";
# also reset Camera Orientation
exiftool -Orientation#=8 -CameraOrientation#=0 -overwrite_original $1
fi
fi
convert -auto-orient -strip -resize x1080 file.jpg file_resized.jpg
vector<signed char> vc;
vc.push_back(1);
vc.push_back(255);
vc.push_back(1);
vc.push_back(1);
cout << find(vc.begin(), vc.end(), 255) - vc.begin() << endl;
}