Previous Thread
Next Thread
Print Thread
Hop To
Joined: Oct 2007
Posts: 361
Likes: 8
Enthusiast
Enthusiast
Joined: Oct 2007
Posts: 361
Likes: 8
I'm trying to wrap my head around how the inline attachments work.

I'm going to describe what I think it means. Please correct me if I'm wrong.

Permissions/Forum/Max file attachment size determines the largest attachment allowed for upload

Attachments/Thumbnail Image Max Width/Height determines the max size of the inline thumbnails displayed at the bottom of a post

Attachments/Medium Image Max Width/Height determines the max size of the image displayed when you click on the inline images to view them

Attachments/Full Image Max Width/Height determines the max size of images stored in the attachment directory

Is my understanding correct? Or is the full-size image stored on the hard drive and only resized for viewing?



The Stovebolt Geek
https://www.stovebolt.com/ubbthreads/ubbthreads.php

Server Information
UBB.threads Version 7.7.5
Release 20201027
Server OS Linux
Server Load 0.16
Web Server Apache/2.4.6
PHP Version 7.4.33
MYSQL Version 5.7.43
Database Size 1.85 GB
Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
The responsive page display takes priority over any image dimensions as a smart fallback; so mobile users can see a huge image on their tiny screens (otherwise they'd be bombarded by something that'd require them to scroll).

The images are processed with the compression settings you setup via the attachments settings; allowing an 8MB upload will allow a user to upload a huge image, that'll be compressed down.

The thumb max height/width affects the display of the thumbnail, medium I don't believe is used anymore, full is the max size the image can be stored as on the server.

If you look at the image information of my attached image you'll see that its scaled to 200x200 (thumb width) as a 30.73KB image (it was 49KB, so it was compressed); since the image was only 600x600 it didn't reach the full size max dimensions, so it retains the dimensions of the original.
Attachments
3019770961872192759.jpg


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Oct 2007
Posts: 361
Likes: 8
Enthusiast
Enthusiast
Joined: Oct 2007
Posts: 361
Likes: 8
OK. So, if we allow 5MB uploads, the size of the file stored in the attachments directory is determined by the setting we use for Attachments/Full Image Max Width/Height?

What determines the size of the images you view when you click on an inline array of images?


The Stovebolt Geek
https://www.stovebolt.com/ubbthreads/ubbthreads.php

Server Information
UBB.threads Version 7.7.5
Release 20201027
Server OS Linux
Server Load 0.16
Web Server Apache/2.4.6
PHP Version 7.4.33
MYSQL Version 5.7.43
Database Size 1.85 GB
Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
If you allow 8MB-12MB uploads (which I recommend, since it's about the highest I've seen from cellphones), you'll end up with images around 400k-700k (depending on compression and full size dimension). They'll be resized to the full size dimensions only if the image exceeds that dimension (I allow 1920 as the max).

The FILESIZE is determined based on the image dimensions and the compression; it'll vary by image, especially using an image with a lot of detail.

When you click on an image and it opens in the lightbox, or you display inline, it should display the image with the css "max-width: 100%;"; which means as wide as the screen allows before trying to stretch the page.

Attached Image:
Original: 7,147 KB, 3036x4048
Parsed: 673 KB, 1440x1920

Compression level for full images: 60%
Attachments
IMG_20181020_143838.jpg


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Oct 2007
Posts: 361
Likes: 8
Enthusiast
Enthusiast
Joined: Oct 2007
Posts: 361
Likes: 8
Thanks. That's the clarification I needed.


The Stovebolt Geek
https://www.stovebolt.com/ubbthreads/ubbthreads.php

Server Information
UBB.threads Version 7.7.5
Release 20201027
Server OS Linux
Server Load 0.16
Web Server Apache/2.4.6
PHP Version 7.4.33
MYSQL Version 5.7.43
Database Size 1.85 GB
Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
I just uploaded an image from this last weekends camping trip; I chose it because of the level of detail, to show an example of compression on a large image.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Oct 2007
Posts: 361
Likes: 8
Enthusiast
Enthusiast
Joined: Oct 2007
Posts: 361
Likes: 8
I've been doing some testing, and I have some questions.

I uploaded a 3.8 MB image as an attachment. Instead of being displayed inline, it displayed as a link. On the hard drive, it was 2.2MB, which is 60% of its original size, so the compression is working as expected. But I *thought* that the file's size would be reduced to 650 pixels (the setting we have in attachments), and it was not.

When I deleted the post, the attachment was deleted as well, although its record was retained in the database.

What am I missing?


The Stovebolt Geek
https://www.stovebolt.com/ubbthreads/ubbthreads.php

Server Information
UBB.threads Version 7.7.5
Release 20201027
Server OS Linux
Server Load 0.16
Web Server Apache/2.4.6
PHP Version 7.4.33
MYSQL Version 5.7.43
Database Size 1.85 GB
Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
The end filesize depends on the image quality you allow (defaults are thumb 200, medium 480, full 1920) and the max dimension you allow (if an image doesn't meet the dimension it will not be resized; the defaults are thumb 80%, medium 70%, full 60%), the level of detail the image has, and the Image Library you're utilizing to process images.

ImageMagick will process images more efficiently, and will more aggressively compress images; the downside is that it doesn't come pre-bundled with PHP like GD (it has to be installed to the local filesystem). Your host likely has it installed, you just have to populate the paths in the UBB.threads "Paths" configuration. I believe there was previously an issue with IM processing image dimensions (the system was rewritten in v7.6.2, whereas the following link is a patch for v7.6.1.1), that discussion can be found here.

The "Max File Size for Displaying Attached Images Inline" setting in the Attachments Settings will allow you to limit the images being displayed to the browser based on how large the image is; I wouldn't have this setting much higher than about a meg as your mobile users will have some pretty large images to push through their data plan.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Oct 2007
Posts: 361
Likes: 8
Enthusiast
Enthusiast
Joined: Oct 2007
Posts: 361
Likes: 8
I have ImageMagick installed and enabled. I read the referenced post and edited the image.inc.php file, and uploads/attachments now work as expected. Thanks for your help.


The Stovebolt Geek
https://www.stovebolt.com/ubbthreads/ubbthreads.php

Server Information
UBB.threads Version 7.7.5
Release 20201027
Server OS Linux
Server Load 0.16
Web Server Apache/2.4.6
PHP Version 7.4.33
MYSQL Version 5.7.43
Database Size 1.85 GB

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
spam issues
by ECNet - 03/19/2024 11:45 PM
Who's Online Now
2 members (ahmed047, Nightcrawler), 615 guests, and 132 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)