方法一:imagemagick
#安装
sudo apt-get install imagemagick
#转化
convert 1.jpeg 1.jpg
方法二:opencv
#include <iostream>
#include<opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>
using namespace std;
using namespace cv;
int main(void){
Mat image=imread("1.jpeg");
if(!image.data){
cout<<"No data!"<<endl;
}
namedWindow("hello1");
imshow("hello1",image);
waitKey(500);
Mat result;
//flip(image,result,0);//1为水平,0为垂直,负数为即水平又垂直
//namedWindow("hello2");
//imshow("hello2",result);
//waitKey(500);
imwrite("1.jpg",image);
}
此时就把1.jpeg修改为1.jpg