bp-attachments icon indicating copy to clipboard operation
bp-attachments copied to clipboard

How to not display original photo (4.5 MB) but download and show only medium size.?

Open podporujeme opened this issue 1 year ago • 9 comments

How to not display original photo (4.5 MB) but download and show only medium size.? by some php snippet, or u add to plugin pls?

imp

podporujeme avatar Jan 28 '24 22:01 podporujeme

Hi, the only way to do it so far is to privately upload the media. We surely need to offer a way to disable large image display: a possible way is to shrink resolution like WordPress does when generating image with specific sizes (thumbnail, medium, large. etc.

Thanks for sharing this point.

imath avatar Jan 29 '24 18:01 imath

@imath for this plugin u can automatic resize image for max resolution 800px width... buddypress is "social network" People dont need view large photos.

podporujeme avatar Feb 01 '24 14:02 podporujeme

Ha, we can never assume we know how a plugin is going to be used. Users will always find a novel way to use something that surprises us as devs (and sometimes delights us, too). :D

I promise that some users will want to use it as a photo sharing repository and will want to store high-res images.

dcavins avatar Feb 01 '24 17:02 dcavins

something like this? (if is blank or zero is disable) Untitled

podporujeme avatar Feb 01 '24 18:02 podporujeme

I agree with @dcavins I believe the best way is to generate a shrinked image for preview and the original one for download.

imath avatar Feb 01 '24 19:02 imath

Yes that would be great.

podporujeme avatar Feb 01 '24 19:02 podporujeme

@imath Just putting in my vote for this too. If we're able to control this through constants, like in BuddyPress, that would be awesome!

An example could be:

define ( 'BP_ATTACHMENTS_THUMB_WIDTH', 350 ); define ( 'BP_ATTACHMENTS_THUMB_HEIGHT', 400 ); define ( 'BP_ATTACHMENTS_FULL_WIDTH', 700 ); define ( 'BP_ATTACHMENTS_FULL_HEIGHT', 800 ); define ( 'BP_ATTACHMENTS_ORIGINAL_MAX_WIDTH', 1024 ); define ('BP_ATTACHMENTS_ORIGINAL_MAX_FILESIZE', 1024 );

bclaim avatar Feb 10 '24 08:02 bclaim

Hi @bclaim thanks for your suggestion 😍

imath avatar Feb 10 '24 10:02 imath

@bclaim Hello, if i input this code to php snippet, it will work? Or i need some modification?

podporujeme avatar Feb 29 '24 18:02 podporujeme