Attachment Improvements By Xon

Attachment Improvements By Xon 2.6.7

No permission to download
It strips EXIF data by re-encoding the JPEGs which might cause the filesize to increase; but that is the only easy out of the box way without finding a significantly more complex jpeg parsing library
 
It strips EXIF data by re-encoding the JPEGs which might cause the filesize to increase; but that is the only easy out of the box way without finding a significantly more complex jpeg parsing library
Now I'm confused, or I wasn't paying close enough attention. Does this re-encoding happen to content already uploaded prior to the addon being installed? Or, just newly added content after install?
 
So can only find one other addon that strips existing photo exif data and that has some recent comments suggesting not to use it. What other options are there? If I convert all photos to web p - would that remove exif data? Only really want to remove the location
 
It strips EXIF data by re-encoding the JPEGs which might cause the filesize to increase; but that is the only easy out of the box way without finding a significantly more complex jpeg parsing library
So will this strip exif data on all existing photos on the site please?
 
Now I'm confused, or I wasn't paying close enough attention. Does this re-encoding happen to content already uploaded prior to the addon being installed? Or, just newly added content after install?
Sorry just seen Xon’s comment above. So does it strip existing images on the site too?
Just for my own sanity, I double-checked some older attachments and for those with some EXIF data, it was not removed. If I removed it from the site and re-uploaded it, the EXIF data was removed correctly.
 
Could I install this addon and just set it to remove exif data on any photos uploaded, and not use the rest of the addon (which I am sure is excellent but I'm just wanting to remove exif data for now).

Also I felt slightly intimidated by the following? If I just use if for exif data, can I just turn everything else off and not need these extra requirements?

This addon assumes the /internal_data folder exists within the webroot, and you do not have a 'deny all;' statement but instead use 'internal;' to secure the internal_data folder.

For example, XenForo is accessible from: /forum rather than then the webroot.

The following must be added to config.php:


Code:


$config['internalDataUrl'] = '/forum/internal_data';


Something similar to the nginx config may be required in your webserver:


Code:


location ^~ /forum/internal_data {<br> internal;<br> add_header Etag $upstream_http_etag;<br> add_header X-Frame-Options SAMEORIGIN;<br> add_header X-Content-Type-Options nosniff;<br> alias /path/to/internal_data;<br>}


To ensure you match how XenForo serves files, add the following headers into your website config for the internal_data folder:


Code:


add_header Etag $upstream_http_etag;<br> add_header X-Frame-Options SAMEORIGIN;<br> add_header X-Content-Type-Options nosniff;
 
Correct, that is only required if you want to use the nginx's X-Accel-Redirect feature.

I've added that block into a spoiler tag to make it clear it is requirements for the X-Accel-Redirect feature and not a general requirement
 
Sorry to keep asking questions. If using the exif stripping option in this addon, are there any issues with rotation of photos - ie posting upside down or sideways? Just been dealing with exiftool and that is an issue with that tool if stripping all exif data - it removes the rotation tag as well. Assume your method is different though.
 
This add-on does attempt to extract the orientation from the EXIF data and then apply those rotations which is where I expect the size differences can come from.
 
Thanks. I was just asking, having been fiddling around with exiftool for existing images and finding that there was a code line that stripped all exif and then replaced the orientation tag after stripping. On checking it seems to have worked.

Is that what you mean? It replaces the orientation after stripping? Thanks.
 
This add-on does attempt to extract the orientation from the EXIF data and then apply those rotations which is where I expect the size differences can come from.
Thanks. I don;t mind if it increases attachment size a bit :-) Not an issue on a small forum. I have installed the addon - apologies for asking so many questions, but where do I find the settings in ACP? Is it under Options-attachments and permissions? Or is there anything anywhere else?

Edit - it's ok I found all the options in Options-Attachments. Thank you. It's a nice addon.

One question. My site is set up to automatically resize images when they get uploaded. Which would kick in first? The exif stripping or the resizing? Or simultaneous? And is there likely to be a conflict? It's not an addon for resizing, just settings and something added in server files (need to check my notes to remember what was done).

Also, the vast majority of photos uploaded have no exif data usually (from phones). It tends to only be images from cameras that have GPS and multiple exif in them. Would the addon just skip these or run to strip/overwrite all images anyway? I'm assuming the latter. Thank you.
 
Last edited:
Now I'm confused, or I wasn't paying close enough attention. Does this re-encoding happen to content already uploaded prior to the addon being installed? Or, just newly added content after install?
On this topic (existing files with exif) - not sure if this is of interest to anyone but this is how I stripped the existing files on site, before adding Xon's addon to strip any newly uploaded files. Via exiftool (with simple instructions!)

 
Thanks. I don;t mind if it increases attachment size a bit :-) Not an issue on a small forum. I have installed the addon - apologies for asking so many questions, but where do I find the settings in ACP? Is it under Options-attachments and permissions? Or is there anything anywhere else?

Edit - it's ok I found all the options in Options-Attachments. Thank you. It's a nice addon.

One question. My site is set up to automatically resize images when they get uploaded. Which would kick in first? The exif stripping or the resizing? Or simultaneous? And is there likely to be a conflict? It's not an addon for resizing, just settings and something added in server files (need to check my notes to remember what was done).

Also, the vast majority of photos uploaded have no exif data usually (from phones). It tends to only be images from cameras that have GPS and multiple exif in them. Would the addon just skip these or run to strip/overwrite all images anyway? I'm assuming the latter. Thank you.
Edit - it's an additional line I have in config.php to allow larger images and override max pixel dimensions.

I have max attachment file size as 12000 and max attachment dimensions as 800 x 600

Do you think there would be any conflict? Maybe you could message me about this? Thank you.

Edit - I can't see there would be any conflict as all I'm doing is allowing larger images size to be uploaded.
 
Last edited:
XF would do the re-size first, and I'm unsure of if that strips EXIF or not and then this add-on does the EXIF stripping. There shouldn't be any conflicts with the feature.

Would the addon just skip these or run to strip/overwrite all images anyway? I'm assuming the latter. Thank you.
It does the EXIF stripping regardless as EXIF is included by most phones and reliably detecting if EXIF is part of a jpeg is remarkably hard.
 
XF would do the re-size first, and I'm unsure of if that strips EXIF or not and then this add-on does the EXIF stripping. There shouldn't be any conflicts with the feature.


It does the EXIF stripping regardless as EXIF is included by most phones and reliably detecting if EXIF is part of a jpeg is remarkably hard.
Thank you very much. It all sounds fine and as expected :-)

It is a point that initially, I thought resizing images would have removed exif - but it doesn't seem to. Prior to stripping files and before using your addon, there was full exif and full GPS Location found on any photo taken by a "proper" camera, None or minimal on most photos taken by phones. I stripped everything existing anyway as it seemed the only way to full get rid of of all GPS location tags, which is why your solution sounds good as well.
 
Last edited:
Back
Top Bottom