For example, /path/employee/john-20240301.jpg. Its cropped file name would be like
"image-cropper-12345678.jpg".
The cropped file base name should be the same: john-20240301. The file extension can be changed.
When the file (photo) is uploaded, the file name is meaningful on server side. Employee photo file names are stored in database.
File rename and copy is workaround, but it can fail and also has performance overhead. It is not necessary if cropper has an option to keep the same base name.
Keep the same file name for croppedFile.
For example, /path/employee/john-20240301.jpg. Its cropped file name would be like "image-cropper-12345678.jpg".
The cropped file base name should be the same: john-20240301. The file extension can be changed. When the file (photo) is uploaded, the file name is meaningful on server side. Employee photo file names are stored in database.
File rename and copy is workaround, but it can fail and also has performance overhead. It is not necessary if cropper has an option to keep the same base name.
Option: bool keepBaseName = true