jaydeepw / poly-picker

Android library project for providing multiple image selection from the device.
406 stars 114 forks source link

Why the photos taken are stored 2 versions ? #42

Open phasuksmit opened 9 years ago

phasuksmit commented 9 years ago

Why the photos taken are stored 2 versions ? both in /DCIM/... and /Pictures/...

uri: /storage/emulated/0/Pictures/1431406896165.jpg uri: /storage/emulated/0/DCIM/Photo_20150512_120139.jpg

Can anyone tell me how to remove one creation process ?

jaydeepw commented 9 years ago

This is a known issues. I will soon look into it and get back to you.

phasuksmit commented 9 years ago

Is one of them created by camera3 and another one created by pp3 ?

I guess that the one from camera3 is used to process in pp3, and you forgot to delete the first one

can u tell me any clue ?

EDIT * I see SimpleCameraHost.getPhotoFilename() include Photo_+ts+.jpg

so the one in DCIM is from cwac camera

jaydeepw commented 9 years ago

No camera3 and pp3 are just proxy test modules that are removed in production. They are not even being called when you have enabled the gradle dependency from maven.

jaydeepw commented 9 years ago

anyway, you can try playing with it and notifiy me of what exactly is causing this. At the moment, I am clueless and need diving in in order to figure the problem culprit out. You help will greatly be appreciated and if possibly, I will release with the fix in 1.0.14

phasuksmit commented 9 years ago

Ok I will tell you then

I'm just novice in github , I'm sorry for any using-mistake .

jaydeepw commented 9 years ago

Its perfectly fine to make mistakes @phasuksmit

phasuksmit commented 9 years ago

I found it .. CwacCameraFragment.java

String path = MediaStore.Images.Media.insertImage(getActivity().getContentResolver(), bitmap, getPhotoFilename(), null);

this not only get path from somewhere, but 'insertImage' also creating new thumbnail and another file too

how can I fix this ? Seems like Android not run file.java, it only open from .class file

jaydeepw commented 9 years ago

You will have to clone this repository, make the changes and send me the PR. I will merge once I feel everything is fixed correctly. If it is not urgent to you, it will need me a day or 2 to get this fixed and out into test builds.

phasuksmit commented 9 years ago

In the cloned file, camera is broken (running in Note2, Note1)

I can't do anything right now

screenshot_2015-05-12-15-57-20

jaydeepw commented 9 years ago

This is strange. A friend of mine uses PolyPicker and he uses Note2 to test.

phasuksmit commented 9 years ago

It's happen to me only from the default cloning link

anyway, I suggest you to fix

String path = MediaStore.Images.Media.insertImage(getActivity().getContentResolver(), bitmap, getPhotoFilename(), null);

change path to anything, may be default gallery path, try not to use insertImage as it will create small photo.

jaydeepw commented 9 years ago

Ahh. Thanks for the help man... I will keep it in mind and fix ASAP. In the meantime test the snapshot build and report the bugs back here. Checkout my G+ post from last evening https://plus.google.com/+JaydeepWagh/posts/VTkVsDwPmpU

noomz commented 7 years ago

I found it's a bug in file https://github.com/jaydeepw/poly-picker/blob/master/PolyPickerDemo/pp/src/main/java/nl/changer/polypicker/CwacCameraFragment.java#L139

I can quick fix by adding pictureTransaction.needByteArray(false);