EXIF data not available to plug-ins

Corel Paint Shop Pro

Moderator: Kathy_9

Post Reply
epp
Posts: 3
Joined: Sun Sep 01, 2013 4:15 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit

EXIF data not available to plug-ins

Post by epp »

I am the author of PTLens, software for correcting lens distortion.

http://epaperpress.com/ptlens/

The software functions by reading EXIF data and, based on this information, determines the camera, lens, and focal length, and automatically corrects lens distortion.

The plug-in is compatible with Photoshop on both the Mac and PC. Unfortunately, EXIF data is not available for plug-ins under PSP. Without EXIF data the user must manually enter camera make, model, lens, and lens focal length. This is a bit onerous for users with zoom lenses.

Work at your end, assuming you have access to a pointer to EXIF data, is trivial. I estimate less than one hour of developer time. As a result, users will have access to automatic correction for distortion via the PTLens plug-in.

I am willing to work with a developer on your end to see this feature implemented in your software.

Technical information follows.
.
	intptr_t simpProp;
	Handle compProp;
	int32 rc;
	int32 size;

	uint8 *exif = NULL;
	rc = getProperty(0x3842494D, propEXIFData, 0, &simpProp, &compProp);
	if (rc == 0) {
		size = getSize(compProp);
		if (size) {
			exif = (uint8 *)lock(compProp, false);
			if (exif) {
				processExif(exif, size);
				unlock(compProp);
			}
		}
		dispose(compProp);
		if (!exif) return;
	}

A call to getProperty returns zero, indicating all is okay. But a call to getSize returns zero, indicating no EXIF data. I tried a different approach. A PSP script, to obtain EXIF data, was successful. But there is no way to pass this information to a plug-in.

Setting an environment variable in the script, and reading the variable in the plug-in, won't work because I need to set an environment variable in a parent process. This is not permitted.

Writing a file from the script, and then reading it back in the plug-in, doesn't work because the script is running in a protected environment where writing files is not allowed.
canuck
Posts: 2037
Joined: Wed Mar 14, 2012 3:28 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit
Location: Deep River, Ontario, Canada

Re: EXIF data not available to plug-ins

Post by canuck »

This is not Corel and we are just users here of the software. Very few Corel developers (if any) ever are in this forum.

You should get in touch directly with Corel if you want them to read your suggestion.
epp
Posts: 3
Joined: Sun Sep 01, 2013 4:15 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit

Re: EXIF data not available to plug-ins

Post by epp »

canuck wrote:This is not Corel and we are just users here of the software. Very few Corel developers (if any) ever are in this forum.

You should get in touch directly with Corel if you want them to read your suggestion.
How do I do this?
LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8-2023
Location: USA

Re: EXIF data not available to plug-ins

Post by LeviFiction »

epp, a script placed in the Scripts-Trusted folder can output a file. I use this method for a very simplistic comparison of functions between versions of PSP to see what has changed.

I output a text file from one PSP and read it in from another. So this is possible.

I agree, Corel should fix this issue or reveal how they allow EXIF in non-standard Photoshop format. It's ridiculous that this isn't accessible for plugins.
https://levifiction.wordpress.com/
epp
Posts: 3
Joined: Sun Sep 01, 2013 4:15 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit

Re: EXIF data not available to plug-ins

Post by epp »

LeviFiction wrote:epp, a script placed in the Scripts-Trusted folder can output a file.
Aha! That works. Thank you.
Post Reply