Being a Photographer and game modder, I have edited photos and other images in Photoshop, resizing them for various venues. I don’t understand the image processing here.
I traced the code to the return statement in PhotoUtils.getScaledDrawable(…). At that point (for a Galaxy Nexus, 4.7", 720x1280):
options.outHeight = 480
options.outWidth = 640
Meanwhile, we set the ImageView for the thumbnail to:
How does 480 compare to 80dp? Are they both pixel measurements?
However, the ImageView is not used for determining the image size. The activity is. The activity for CrimeFragment and ImageFragment is CrimePagerActivity. So, the call will return the same result for both the thumbnail and fullscreen images.
This brings two questions:
If we are going to use the screen size for both images, why do we need two calls? Can’t the same image used for the thumbnail be used for the fuilscreen one?
At the time the picture is taken, why can’t we create two image files then, a small one for the thumbnail and a larger one for the fullscreen display? Do we need the full image as captured by the camera (which could be an 8mb or larger file)? Wouldn’t it be a lot more efficient to save only the images we need for the two views, doing the calculations once at capture time instead of every time the image is displayed? Or are we going to save the full one for possible printing? The app data is being saved to internal storage, not the external SSD. Saving the full size image is a waste of space.
Another question I have is why we don’t use the UUID of the Crime for the filename, instead of generating a new one? Then the app can check for the existence of images without needing to save the filename separately.