High resolution contact pictures in Marshmallow - what is their size and where are they stored


Question

Trying to answer this question How to backup large contact photos?, I wanted to compare the picture size after restore



I do see a database for contacts , as mentioned in Narayanan's answer here - location hasn't changed from Gingerbread days !



/data/data/com.Android.providers/contacta/databases/contracts.db



How do I see the picture and it's size ??



I gather one has to SQLlite viewer but Apps from play store didn't help and I am new to SQL stuff. It would be nice if I can get a way of doing this (preferably without using PC but if that's inevitable , it's fine )



Edit:




  • Android version 6.0, Rooted


  • When I see /data/data/com.android.providers.contacts/files/photos/ they pertain to WhatsApp photos not contact pictures



Answer

Assume you're using an AOSP ROM, you just missed the correct answer:



/data/data/com.android.providers.contacts/files/photos


Whatever the original size of the image is, it will be resized to 720*720 and shrinked to less than 64 KiB.



To verify this by yourself, get these commands executed in a root shell. You need BusyBox or Termux for find and xargs Android M introduced ToyBox which has find and xargs built in.



# cd /data/data/com.android.providers.contacts
# ## Add a picture of your choice to a contact
# find -type f | xargs ls -t


See the output. find -type f outputs every single file found under current working directory, and xargs use piped stdin as arguments to ls -t, which lists and sorts all files from the command line by last modification time. You will see that the top 3 files are



./databases/contacts2.db
./databases/contacts2.db-journal
./files/photo/3 (num. varies dpd. on your env.)


The answer is clear as seen above.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes