• Resolved michaelwacker57

    (@michaelwacker57)


    Hello,

    I’m trying to rename some EXIF labels (e.g. E#0110 “Model:” -> “Camera:”, E#013B “Artist:” -> “Photographe:”) in Photo Albums > Settings > Advanced settings > EXIF and IPTC.

    The change IS saved: after reloading the settings page the new text is still there, and the wppa_exif table contains it. For example, in phpMyAdmin:

    SELECT id, photo, tag, description, f_description FROM l3va_wppa_exif WHERE tag IN (‘E#0110′,’E#8827’) ORDER BY photo

    result:

    • photo = 0, E#0110, description = “Camera:”
    • photo = 0, E#8827, description = “ISOSpeedRatings:”
    • photo = 20, 21, 22…, E#0110, description = “Canon EOS 5D Mark II” (values only, no label)

    But on the front end (EXIF box under the slideshow and in the enlarged view) the labels are still the old ones, and they don’t even match my table: it shows “Model” (no colon) instead of “Camera:”, and “ISO” instead of “ISOSpeedRatings:”. The generated HTML is:

    Model

    What I already tried:

    • Deleted all photos and re-uploaded them: still “Model”.
    • Cleared the browser cache (Ctrl+F5) and tested in a private window.
    • Searched wp_options for ‘Model’ in wppa options: no result.

    The per-photo rows of the exif table contain only values, and the labels are not stored in wp_options, so I can’t find where the displayed label comes from.

    Questions:

    1. Where does the label shown in the EXIF box come from?
    2. How can I change it (e.g. “Model” -> “Camera”)? Is there a setting I missed, or a filter/hook I can use?

    Plugin version: 9.3.04.004

    Thank you very much for your help, and for the plugin!

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Thank you for finding this bug. I have patched the current release version 9.3.04.004.
    So, download https://downloads.wordpress.org/plugin/wp-photo-album-plus.9.3.04.004.zip and install
    That will fix it

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    To answer your question: The labels of the exif items that exist on the site are the descriptions in the db table for photo id = 0, and therefor editable and appear on the settings page.

    The issue was that the search in the array of editatble used a modified index; i do not remember why i modified that, but i do know its wrong, so i unmodified it:

    Changed:
    $editabletags[ hexdec( substr( $item['tag'], 2, 4 ) ) ] = trim( $item['description'], ': ' ); (wrong)
    into:
    $editabletags[ $item['tag'] ] = trim( $item['description'], ': ' ); (right)

    See: wppa-exif-iptc-common.php line 3640

    When a label is not found in the editable array, it uses the default (‘Model:’ in your case). Same file line 3663

    Thread Starter michaelwacker57

    (@michaelwacker57)

    Hello, I have just open the file to remplace the wrong line and all is ok now! Thanks a lot!

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Great!

    Thread Starter michaelwacker57

    (@michaelwacker57)

    Can I ask you one last thing that’s absolutely not a problem? I would like to translate into English the text “Afficher les données Exif/Cacher les données Exif” but I can’t find where it is in the code? Thanks in advance.

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    This is english text translated into french. pls tell me where it shows up so i can find it in the code

    Thread Starter michaelwacker57

    (@michaelwacker57)

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    In wppa-boxes-html.php line 4730:

    		$result .= 	'<a' .
    						' class="-wppa-exif-table-' . wppa( 'mocc' ) . '"' .
    						' onclick="' . esc_attr( $onclick ) . '"' .
    						' style="cursor:pointer;' . $d1 . '"' .
    						' >' .
    						__( 'Show EXIF data', 'wp-photo-album-plus' ) .
    					'</a>';
    
    		$onclick = 	'jQuery( \'.wppa-exif-table-' . wppa( 'mocc' ) . '\' ).css( \'display\', \'none\' );' .
    					'jQuery( \'.-wppa-exif-table-' . wppa( 'mocc' ) . '\' ).css( \'display\', \'\' )';
    
    		$result .= 	'<a' .
    						' class="wppa-exif-table-switch wppa-exif-table-' . wppa( 'mocc' ) . '"' .
    						' onclick="' . esc_attr( $onclick ) . '"' .
    						' style="cursor:pointer;' . $d2 . '"' .
    						' >' .
    						__( 'Hide EXIF data', 'wp-photo-album-plus' ) .
    					'</a>';
    

    Sorry my first reply was wrong.
    This is correct:

    change __( 'Show EXIF data', 'wp-photo-album-plus' ) into 'Show EXIF data'
    and __( 'Hide EXIF data', 'wp-photo-album-plus' ) into 'Hide EXIF data'

Viewing 8 replies - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.