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 » Sat Oct 20, 2018 5:59 pm

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 » Sat Oct 20, 2018 6:43 pm

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
Registered User
Posts: 13000
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Stripping EXIF data from uploaded images

Post by 3Di » Sun Oct 21, 2018 2:43 am

If dimensions are greater than 0x0 you don't need the above modification, EXIF data will be stripped anyway.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate

:game_die: The new Dice Roller extension for phpBB 3.2 is out! :game_die:

Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

Post Reply

Return to “phpBB Custom Coding”

Who is online

Users browsing this forum: No registered users and 4 guests