diff --git a/app/src/main/java/org/foxarmy/barcodescannerforemployees/AddProductFragment.kt b/app/src/main/java/org/foxarmy/barcodescannerforemployees/AddProductFragment.kt index 1d4f76b..684cc8f 100644 --- a/app/src/main/java/org/foxarmy/barcodescannerforemployees/AddProductFragment.kt +++ b/app/src/main/java/org/foxarmy/barcodescannerforemployees/AddProductFragment.kt @@ -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 {