kasiel
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-
Forum: Plugins
In reply to: [Meow Lightbox] Incorrect output: maximum ISO value = 65535Thank you, that was helpful! 🙂
The problem: The very high iso values are to find in EXIF[‘UndefinedTag:0x8832’], not in the EXIF[‘ISOSpeedRatings’] as I expected.
I created an new folder in wp-content/plugins: meow-lightbox-iso-fix
I created a new file: meow-lightbox-iso-fix.php within the folder with this code:<?php
/**
* Plugin Name: Meow Lightbox ISO Fix
* Description: Liest das ISO aus EXIF (Nikon-Tag 0x8832) und gibt es an Meow Lightbox zurück.
* Version: 4.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_filter( 'mwl_img_iso', 'kk_force_exif_iso_from_tag_8832', 10, 3 );
function kk_force_exif_iso_from_tag_8832( $iso, $id, $meta ) {
// Dateipfad des Attachments holen
$file_path = get_attached_file( $id );
if ( ! $file_path || ! file_exists( $file_path ) ) {
return $iso;
}
// EXIF-Funktion vorhanden?
if ( ! function_exists( 'exif_read_data' ) ) {
return $iso;
}
// EXIF-Daten laden (alle Sektionen)
$exif = @exif_read_data( $file_path, 0, true );
if ( ! is_array( $exif ) || ! isset( $exif['EXIF'] ) ) {
return $iso;
}
$exif_exif = $exif['EXIF'];
// 1. Nikon / hoher ISO-Wert in UndefinedTag:0x8832
if ( isset( $exif_exif['UndefinedTag:0x8832'] ) ) {
$val = $exif_exif['UndefinedTag:0x8832'];
// Kann theoretisch auch ein Array sein
if ( is_array( $val ) ) {
$val = reset( $val );
}
$new_iso = (int) $val;
if ( $new_iso > 0 && $new_iso < 1000000 ) {
return $new_iso; // z.B. 80000
}
}
// 2. Fallback: normale ISO-Felder versuchen
if ( isset( $exif_exif['ISOSpeedRatings'] ) ) {
$val = $exif_exif['ISOSpeedRatings'];
if ( is_array( $val ) ) {
$val = reset( $val );
}
$fallback_iso = (int) $val;
if ( $fallback_iso > 0 && $fallback_iso < 1000000 ) {
return $fallback_iso;
}
}
if ( isset( $exif_exif['PhotographicSensitivity'] ) ) {
$fallback_iso = (int) $exif_exif['PhotographicSensitivity'];
if ( $fallback_iso > 0 && $fallback_iso < 1000000 ) {
return $fallback_iso;
}
}
// 3. Wenn alles nichts bringt → ursprünglichen Wert von Meow zurückgeben
return $iso;
}I’m sorry!
I didn’t disabled the plain html.
Now it is working as expected.
Thank you for the support!Thank you for the answer.
Yes, the campaign token is set.
The form is back again under all my articles.
The 404 ist back again, too. And the address of the recipient is not entered in the list.
Any ideas??
Viewing 4 replies - 1 through 4 (of 4 total)