Photo Upload Test Thread

It's already installed. But:
  • Requires ImageMagick
  • Requires exec() executi

I found another section for Xen Gallery in Admin. I set it to 1024 x 1024. GD works fine for most things. I think it has issues if you site has so much image processing that it starts to run out of memory or you need more advanced image manipulation.

ImageMagick is installed on the server but it's only command line. To make it work with PHP we need the pecl imagick extension, which can't be installed w/o root.
 
It's already installed. But:
  • Requires ImageMagick
  • Requires exec() executi

I read that wrong. We do have ImageMagick and I believe we can do exec() from PHP. But I don't think we should use it as long as GD is working.

Also, I don't think we need the Image Resizer plugin. That is set to 1600 x 1600, but has no affect because attachments and media gallery are separately set to 1024 x 1024.
 
really large embedded picture:

2013M2Crash.jpg
 
So that's pretty nice, if you try to embed a giant picture, it will size it to your browser automatically. Although it'll still be a large download.
 
ImageMagick allows compression though.

Compression really doesn't count for much in this day of broadband. Resizing will do the most for file size. For example, the 5.1MB file I uploaded became 373kb when it was resized down to 1024px. That's about a 55% quality rate according to Photoshop, which is not great quality, so depending on the photo, you may be able to see quality degradation with naked eye.

I usually save my photos as 92% and the same photo at that quality level and 1024px would be 816KB. It is more than double the size, but 400kb vs 800kb over broadband is negligible. More of an issue on mobile when you don't have LTE.
 
Last edited:
Compatible XF Versions:
1.0
1.1
1.2
1.3
1.4
Some useful info about attachments/fotos in Xenforo:


Where are attachments stored?
If you were used to vBulletin there was a setting if you want to store the attachments in the file system (doesn't stress your database) or in the database (prohibits synchronization problems if you use several servers).
Xenforo stores them solely in the file system.


How are the files organized?
vBulletin used the userid for the structure of the directories. In Xenforo its slightly different:

The directory for the avatars are based on the userid, for all other attachments a sequential number is generated, the attachment id, a number which shows up also in the file name.

location for attachments: internal_data/attachments
location for thumbnails: data/attachments

You can change this path in config.php:
$config['internalDataPath'] = 'new_internal_data_path';

To both types of attachments applies: for every 1000 files a new directory is created. Attachments with id 0-999 can be found in directory 0, id 1000-1999 are in directory 1 and so on....


How are the attachments linked to content (database tables)?
xf_attachment is the link between content (post) and attachment, it also contains the date and the number of views
xf_attachment_data is the link between user and attachment and also contains file name, file size, thumbnail size
xf_attachment_view is a memory-based table used for storing view data.

Important info for photo communities:

The problem:
If you set the "Maximum Attachment File Size" too small (e.g. the default 1 MB) your users are frustrated because a typical photo today is larger and they get an error message. Then they either give up or use one of the online picture tools
If you use a higher setting (e.g. 10 MB) the users are happy because they can upload all their photos, but now the admin has a problem due to increased disk space usage, increased backup time, increased traffic

The solution:
Set the "Maximum Attachment File Size" to something useable (e.g. 10 MB)
Set "Maximum Attachment Image Dimensions" to e.g. 800x600 pixels or 1200x1000 pixels
This way the users are able to upload large photos but Xenforo automatically resizes the photo after the upload to the maximum dimension!

An example:

Photo xyz.jpg
File size 4 MB
Original: 2816x2112 = 5.947.392

Maximum set to 1200x1000 = 1.200.000

Photo will be resized to 1200x900 and uses only 350 KB.
 
photo as attachment
This photo is an example of what I mentioned in the other thread. I click on it and it opens in another window on safari on my iPhone. Is that what is supposed to happen with this type of file?
 
This photo is an example of what I mentioned in the other thread. I click on it and it opens in another window on safari on my iPhone. Is that what is supposed to happen with this type of file?

I don't think that's the way it's supposed to work. When I click on the photo (snow & trees) from my iPhone Safari, it opens on top of the page in that black photo viewer.

This seems like another one of those things that's gonna be a pain to figure out .. ugh.
 
Back
Top Bottom