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 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 {
|
||||
|
|
Loading…
Reference in New Issue