Stripping EXIF data from uploaded images

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
astantine85
Registered User
Posts: 2
Joined: Sat Oct 20, 2018 5:51 pm

Stripping EXIF data from uploaded images

Post by astantine85 »

Hi I am using the following modifications to the plupload.php file to remove all EXIF data from uploaded images.

Code: Select all

	public function generate_resize_string()
	{
		$resize = '';
		if ($this->config['img_max_height'] > 0 && $this->config['img_max_width'] > 0)
		{
			$resize = sprintf(
				'resize: {width: %d, height: %d, quality: 85, preserve_headers: false},',
				(int) $this->config['img_max_width'],
				(int) $this->config['img_max_height']
			);
		}

		return $resize;
	}
However, this doesn't seem to be working. When I download an uploaded image, I can still see all EXIF data.

Any help would be highly appreciated. Thanks!
astantine85
Registered User
Posts: 2
Joined: Sat Oct 20, 2018 5:51 pm

Re: Stripping EXIF data from uploaded images

Post by astantine85 »

Hi I identified the issue. The Maximum image dimensions in General > Attachment settingsshould be greater than 0 x 0 (default value) in order for the function to be called.
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: Stripping EXIF data from uploaded images

Post by 3Di »

If dimensions are greater than 0x0 you don't need the above modification, EXIF data will be stripped anyway.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
Post Reply

Return to “phpBB Custom Coding”