Problems, need help? Have a tip or advice? Post it here.
13 posts Page 1 of 2
Hello, I've been working on a school project for a while now and could really use some help.

I cannot call the EXIF meta data from my images. I've checked that my images all have meta data available to be called. I've even called it using exif.js but can only get that to work on 1 image as it calls it by a unique id. So, I've changed my template to gallery settings so that the EXIF variables will be available to me. Then I've set my variables just like this:
Code: Select all
      <cms:pages masterpage='grida1.php' >
            <div class="grid__item" data-size="1280x961">
               <a href="<cms:show gg_image />" class="img-wrap"><img src="<cms:show gg_image />" alt="img04" />
                  <div class="description description--grid"><cms:show image_title/>
                  <div class="details">
                           <li><i class="icon icon-camera"></i><span><cms:exif><cms:show exif_make /></cms:exif></span></li>
                           <li><i class="icon icon-focal_length"></i><span><cms:exif><cms:show exif_make /></cms:exif></span></li>
                           <li><i class="icon icon-aperture"></i><span><cms:exif><cms:show exif_make /></cms:exif></span></li>
                           <li><i class="icon icon-exposure_time"></i><span><cms:exif><cms:show exif_make /></cms:exif></span></li>
                           <li><i class="icon icon-iso"></i><span></span><cms:exif><cms:show exif_make /></cms:exif></li>

The link to the page I'm working on is here:

Please let me know what I'm doing wrong here. Thanks.

The way things currently work in Couch, the exif data is extracted from uploaded images (and saved in the database) only if
1. the template has been declared using gallery='1'
2. it has been explicitly set in couch/config.php file that exif data needs to be extracted.

You can find all the details here - ... #exif-data

I think the example given there should be helpful.
Just one more thing, in case your template was not originally declared as 'gallery', any images uploaded to it will not show their exif data. Once you convert the template to make it gallery, you'll have to re-upload the images.

Hope this helps.
Hey KK,

My template was already set to 1 and my config was set to 1 as well to allow EXIF variables. I removed the template, reuploaded it, and uploaded a new picture that has confirmed meta data, but still had no luck.

However, I forgot to mention that I am getting an error when I upload each picture. The error alert shows but the picture still goes through and is view-able on the site. I'm thinking this must be the cause as I feel like I have followed the documentation fairly closely. After actually reading the error, I see a something important in the line reading: "..phpExifReader has deprecated constructor..." which seems like the problem.

Code: Select all
[Error] File: id=o_1brm8nakt1drahspmplhea1qera, name=METADATA3.jpg, type=image/jpeg, size=310433, origSize=310433, loaded=310433, percent=100, status=DONE, lastModifiedDate=Thu Oct 05 2017 07:38:40 GMT-0500 (Central Standard Time) Info: response=<br />
<b>Deprecated</b>:  Methods with the same name as their class will not be constructors in a future version of PHP; phpExifReader has a deprecated constructor in <b>/home/hsvgridp/public_html/couch/includes/phpExifRW/</b> on line <b>314</b><br />, status=200, responseHeaders=Alt-Svc: h2=":443"; ma=60

Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0

Connection: keep-alive

Content-Encoding: gzip

Content-Type: text/html; charset=utf-8

Date: Thu, 05 Oct 2017 12:38:58 GMT

Expires: Mon, 26 Jul 1997 05:00:00 GMT

Last-Modified: Thu, 05 Oct 2017 12:38:58 GMT

Pragma: no-cache

Server: nginx

Transfer-Encoding: chunked

Vary: Accept-Encoding

X-Content-Type-Options: nosniff

X-XSS-Protection: 1; mode=block

Thanks for the details.
Yes, that could indeed be the reason for the problem.

Strangely, I had fixed that deprecated constructor several months back but somehow the later changes overwrote that and caused this regression.

Have committed the change again to GitHub.
Am PMing you the sole modified file. Please test and let me know if that helps rectifying the reported issue.

Hey KK,

This removed the error but I still cannot get EXIF data to show up on Couch. I removed whole template, re-uploaded, and uploaded a new picture that has never been in DB to test for EXIF data. Not sure what else it could be. I can provide files for project if you'd be willing to look through the code and see if I've made a mistake.

Preferably, if your site happens to be online, please get me FTP access to it and I can take a look.
Else please PM me the template with the actual (pristine) images you are using.
Thanks for the creds.

I had a look and found that the exif info *is* getting extracted but, for some reason, it includes only some of the settings.
For example, a test image I used yielded only these values -
Code: Select all
    [color] => Color
    [Height] => 583
    [Width] => 874
    [resolution] => 874x583
    [resolutionUnit] => 0

While the *same* image when used on my test setup, showed the following -
Code: Select all
    [aperture] => 1.8000001165881
    [color] => Color
    [DateTime] => 2016:09:30 10:47:55
    [dateTimeDigitized] => 2016:09:30 10:47:55
    [Height] => 583
    [Width] => 874
    [exifVersion] => 0220
    [exposureBias] => 0.00 (0/1)
    [exposureMode] => Manual Exposure
    [exposure] => Reserved
    [exposureTime] =>  0.022 s (1/45) (1/45)
    [fnumber] => f/1.8
    [flashUsed] => No
    [focalLength] => 50.00 (50/1)
    [isoEquiv] => 1600
    [make] => Canon
    [meteringMode] => matrix
    [model] => Canon EOS 5D
    [resolution] => 874x583
    [resolutionUnit] => Inches
    [screenCaptureType] => Standard
    [software] => Adobe Photoshop CS6 Windows
    [whiteBalance] => 0
    [xResolution] => 300.00 (300/1) 0
    [yResolution] => 300.00 (300/1) 0

So, yes, there is an issue here.
Seems like the third-party library used for extracting exif info (phpExifRW) is having problem on your setup.

As to why that is so, to find that will require digging deeper but, as I said, it is a third-party library that I am not familiar with.

I'll definitely try to resolve the problem when I have the required time on my hands. However, as of now, I am sorry but I won't be able to put this issue in my priority list.
Hey KK,

Thanks so much for giving it a try. I appreciate the help very much.

For now, I may look into exif.js to pull data as that was pulling all the data from one image for me. Just had trouble getting it to work on all of the images as it uses the unique id tag to apply to images and was not working when I tried selecting by the img tag or something. Ill look for help on that end but, please let me know if you find time and figure it out using Couch though.

Many thanks!
Using exif.js ( seems to be a perfect alternative.

I had a look at it and found that one can easily use it with multiple images as iterated by Couch <cms:pages> tag.
Please try this (assuming exif.js has been downloaded and placed in /js folder of the site's root) -
Code: Select all
    <script src="<cms:show k_site_link />js/exif.js"></script>
        function getExif(id) {
            var img = document.getElementById(id);

            EXIF.getData(img, function() {
                var allMetaData = EXIF.getAllTags(this);
                var allMetaDataSpan = document.getElementById('meta-'+id);
                allMetaDataSpan.innerHTML = JSON.stringify(allMetaData, null, "\t");

<cms:pages masterpage='gallery.php' >
    <img src="<cms:show gg_image />" id="img-<cms:show k_page_id />" onload="getExif('img-<cms:show k_page_id />')" />
    <pre id="meta-img-<cms:show k_page_id />"></pre>

As you can see, I am using 'k_page_id' variable to craft unique IDs for each image and its associated element (<pre> in this sample) that displays the extracted exif info.

In fact, I already tried this on your setup so you just have to review if it suits your purpose.
Do let me know if this would help.
Hey KK,

Wow, this is great. I've got it working on all my pages to show the desired EXIF data after reviewing your example.

Thanks very much!
13 posts Page 1 of 2

Who is online

In total there are 5 users online :: 1 registered, 0 hidden and 4 guests
(based on users active over the past 5 minutes)

Users browsing this forum: Google [Bot] and 4 guests