fixed wrong seqence
This commit is contained in:
parent
ac5be50f2b
commit
364e78d203
|
@ -47,11 +47,12 @@ class AddProductFragment : Fragment() {
|
||||||
val tempfile = File(requireContext().filesDir, "image.png")
|
val tempfile = File(requireContext().filesDir, "image.png")
|
||||||
val imageContent = tempfile.inputStream().readBytes()
|
val imageContent = tempfile.inputStream().readBytes()
|
||||||
val imageHash = imageContent.toString(Charsets.UTF_8).md5()
|
val imageHash = imageContent.toString(Charsets.UTF_8).md5()
|
||||||
generateThumbnailForImage(context!!, imageHash)
|
|
||||||
|
|
||||||
pictureFile = File(picturesPath, "$imageHash.png")
|
pictureFile = File(picturesPath, "$imageHash.png")
|
||||||
Files.move(tempfile.toPath(), pictureFile.toPath(), StandardCopyOption.REPLACE_EXISTING)
|
Files.move(tempfile.toPath(), pictureFile.toPath(), StandardCopyOption.REPLACE_EXISTING)
|
||||||
tempfile.delete()
|
tempfile.delete()
|
||||||
|
generateThumbnailForImage(context!!, imageHash)
|
||||||
|
|
||||||
binding.imageView.setImageURI(getImageUri(requireActivity(), pictureFile))
|
binding.imageView.setImageURI(getImageUri(requireActivity(), pictureFile))
|
||||||
Log.i("QWERTYUIOP", "Picture saved")
|
Log.i("QWERTYUIOP", "Picture saved")
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue