![]() |
![]() |
![]() |
Using PEL in applications | PHP EXIF Library |
Call to a member function
setValue() on a non-object
" mean?This is the error PHP gives when you call a method on a variable which is not an object.
PEL uses objects to represent the entire structure of a JPEG image, and many of the methods defined on those objects return other objects. In particular, the method PelJpeg::getSection() returns a PelJpegContent object and PelIfd::getEntry() returns a PelEntry object.
But both methods can return null
if no such
section or entry exist. The correct way to use them is thus
something along the lines of:
- $app1 = $jpeg->getSection(PelJpegMarker::APP1);
- if ($app1 instanceof PelExif) {
- /* Do something with the EXIF data. */
- } else {
- /* Sorry --- no EXIF data found. */
- }
The same principle applies to the return values of PelIfd::getEntry() and all other methods which return objects.
No, PEL only deals with EXIF data, and no such extension is planned. Try taking at look at the PHP JPEG Metadata Toolkit which should handle IPTC along with a huge number of other metadata formats.
Please ask your questions on the PEL Development List. If an answer is found, then the FAQ will be updated.
![]() |
![]() |
![]() |
Using PEL in applications | PHP EXIF Library |
Documentation generated on Fri, 18 Feb 2005 01:43:09 +0100 by phpDocumentor 1.3.0RC3