fixed wrong seqence

This commit is contained in:
leca 2024-10-02 11:21:43 +03:00
parent ac5be50f2b
commit 364e78d203
1 changed files with 2 additions and 1 deletions

View File

@ -47,11 +47,12 @@ class AddProductFragment : Fragment() {
val tempfile = File(requireContext().filesDir, "image.png")
val imageContent = tempfile.inputStream().readBytes()
val imageHash = imageContent.toString(Charsets.UTF_8).md5()
generateThumbnailForImage(context!!, imageHash)
pictureFile = File(picturesPath, "$imageHash.png")
Files.move(tempfile.toPath(), pictureFile.toPath(), StandardCopyOption.REPLACE_EXISTING)
tempfile.delete()
generateThumbnailForImage(context!!, imageHash)
binding.imageView.setImageURI(getImageUri(requireActivity(), pictureFile))
Log.i("QWERTYUIOP", "Picture saved")
} else {