hippware / rn-chat

MIT License
5 stars 0 forks source link

MVP Photo Resizing Discussion #106

Closed zavreb closed 7 years ago

zavreb commented 7 years ago

Per extensive discussion with Design:

For the MVP Tiny Robot will only display mobile device native camera image sizes (which should account for 80% of images uploaded):

(These numbers are a reflection of Instagram's adaption to the iOS 10 update)

All of these images when presented as thumbnails will be cropped to 1x1 ratios. These thumbnails can be found in the Bot Profile as well as the Messenger flow.

If a user uploads a non mobile camera image, please recrop the image to the one it fits the closest to: Square/Vertical/Horizontal

Unfortunately, with this build, mobile panoramic images will be automatically cropped to horizontal images. With this build we will not let the user choose the cropping, we will simply take the center of the image and crop it from there.

Thoughts? @benghippware @aksonov

zavreb commented 7 years ago

@thescurry FYI ^

benghippware commented 7 years ago

Questions to be discussed:

These are related questions. To answer them, I think we can consider the following question:

If we change our "image policy", do we want it to take effect for all existing photos, or only for future photos? In other words, do we want to retain flexibility for the future?

If we want future policy changes to affect all photos (and not just new photos) in the future, then we should probably keep (a copy of) the original (so we can apply new policies to them). If we keep the original, then it should be stored on the server side ... which implies processing is to be done on the server side.

benghippware commented 7 years ago

Square Image: 1080 x 1080 (640 x 640) Vertical Image: 1080 x 1350 Horizontal Image: 1080 x 566

The dimensions for "Square Image" are ambiguous. I presume the "640 x 640" can be ignored?

I don't think solely cropping is sufficient for enough cases. We'll have to do some rescaling too, yes?

What if the images are small ie. 480x480? Do you want them to be upscaled?

zavreb commented 7 years ago

The 480 should be upscaled correct to the a 640. These are going to be small use cases so it'll be fine.

zavreb commented 7 years ago

Questions to be discussed:

Should processing (ie. cropping et al) be done on the client side or the server side? Should the original image be kept?

Automatic cropping will be done on the server side. Client will have no flexibility for MVP.

If we change our "image policy", do we want it to take effect for all existing photos, or only for future photos? In other words, do we want to retain flexibility for the future?

Image policy should apply for future photos. Users can always fix their photos if they don't like them.

If we want future policy changes to affect all photos (and not just new photos) in the future, then we should probably keep (a copy of) the original (so we can apply new policies to them). If we keep the original, then it should be stored on the server side ... which implies processing is to be done on the server side.

We can do this post MVP if it becomes a top issue. TR is a location bot, not a photo one, so I'm gunning that it won't become an issue.

benghippware commented 7 years ago

The 480 should be upscaled correct to the a 640. These are going to be small use cases so it'll be fine.

Sorry, this is not enough information.

Is the square dimension 1080 x 1080 or 640 x 640?

What is the minimum image size that we'll accept? If images are smaller than the minimum, the server will reject them?

I presume that any image that is larger than the minimum size will be upscaled if needed?

benghippware commented 7 years ago

All of these images when presented as thumbnails will be cropped to 1x1 ratios.

Are thumbnails generated on the server side or the client side?

If server side, this is additional work. It's not simply a case of photo resizing.

If client side, this is also work for the client (of course).

zavreb commented 7 years ago

@benghippware client side. I'll create a ticket #125

@aksonov do we know if there's a thumbnail generator for the client side?

aksonov commented 7 years ago

@zavreb I don't see any sense to generate thumbnail for the client side - it is better just crop image runtime to save disk space. Even more, app stores images within temp folder (to avoid increasing of app space), so it looks like cache. There is no sense to add thumbnail to this cache because presence is not guaranteed.

One possible advantage for server generation is network & CPU performance during bot queries (especially during future spatial search) when we need to display many bots on the map or as search results). With server-generated thumbnails app will work much faster (no need to load huge pictures just to display small circle icon).

cc @benghippware

benghippware commented 7 years ago

@aksonov

We've established that we don't need thumbnails (where thumbnail = separate version of the image) because it can be done (automatically) by iOS/React Native/"runtime".

Do we actually need to do photo resizing/cropping or can it also be done by iOS/React Native/"runtime" or through layout?

aksonov commented 7 years ago

Yes, it cold be done without problems. Even more, one thought is to upload cropped thumbnail as bot icon so we will save a lot of traffic during bot search p