One of my software create photo gallery and it allows to update existing gallery → If a picture has not be modified then I don’t create it again. Then if I add a photo to a gallery I do not need to re-upload all the photos on the server.
To check if a photo changed, I check its size (width x height) and its size in byte. But I have a problem with the size (in bytes).
Please run the attach project “TestPictureSave.xojo_binary_project”, run it and select a picture file (bigger than 800 x 600), click the save button. The first time you click it and it will create a reduce picture (800 x 600) and save it adding “_Resized” to he file name.
Without doing anything else (simply run on the Break), click this save button again.
The program will load in “ImgTampAv1” the reduced picture file you just saved (if you look at it in the Debugger there is no Graphics).
Then the program will create “ImgTampAv2” from “ImgTampAv1“ (this time there is Graphics).
Then the program will create “ImgTampAp” from “ImgOriginal“ (with Graphics too).
I put those picture in MemoryBlock and I don’t understand why “ImgTampAv2” and “ImgTampAp” are not identical in JPG and TIFF (they are in PNG and BMP). I know JPG loses quality but “ImgTampAv2” is exactly “ImgTampAp” I saved before.
Do I do something wrong or is it a normal way?
TestPictureSave.xojo_binary_project.zip (14.7 KB)