Merge branch 'main' of git.indoodle.com:jason/joomer-efsw-file-monitoring
This commit is contained in:
commit
e31eab7e80
@ -16,7 +16,7 @@ void flip_image_vertically(unsigned char* data, int width, int height, int chann
|
||||
bool STOP = false;
|
||||
|
||||
void sigend( int ) {
|
||||
std::cout << std::endl << "Bye bye" << std::endl;
|
||||
std::cout << std::endl << "close file monitoring" << std::endl;
|
||||
STOP = true;
|
||||
}
|
||||
|
||||
@ -71,9 +71,15 @@ class UpdateListener : public efsw::FileWatchListener {
|
||||
if (image_data) {
|
||||
std::cout << "Successfully loaded " << filename << " (" << width << "x" << height << ")" << std::endl;
|
||||
flip_image_vertically(image_data, width, height, channels);
|
||||
std::string flipped_filename = dir + "flipped_" + filename;
|
||||
stbi_write_jpg(flipped_filename.c_str(), width, height, channels, image_data, 100);
|
||||
stbi_image_free(image_data);
|
||||
// Save flipped image
|
||||
|
||||
std::string flipped_filename =
|
||||
dir + "flipped_" + filename.substr( 0, filename.length() - 3 ) + "png";
|
||||
//stbi_write_jpg(flipped_filename.c_str(), width, height, channels, image_data, 100);
|
||||
stbi_write_png( flipped_filename.c_str(), width, height, channels, image_data,
|
||||
width * channels );
|
||||
|
||||
//stbi_image_free(image_data);
|
||||
STOP = true;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user