wp_exif_frac2dec example

if ( ! empty( $exif['Artist'] ) ) {
                $meta['credit'] = trim( $exif['Artist'] );
            } elseif ( ! empty( $exif['Author'] ) ) {
                $meta['credit'] = trim( $exif['Author'] );
            }
        }

        if ( empty( $meta['copyright'] ) && ! empty( $exif['Copyright'] ) ) {
            $meta['copyright'] = trim( $exif['Copyright'] );
        }
        if ( ! empty( $exif['FNumber'] ) && is_scalar( $exif['FNumber'] ) ) {
            $meta['aperture'] = round( wp_exif_frac2dec( $exif['FNumber'] ), 2 );
        }
        if ( ! empty( $exif['Model'] ) ) {
            $meta['camera'] = trim( $exif['Model'] );
        }
        if ( empty( $meta['created_timestamp'] ) && ! empty( $exif['DateTimeDigitized'] ) ) {
            $meta['created_timestamp'] = wp_exif_date2ts( $exif['DateTimeDigitized'] );
        }
        if ( ! empty( $exif['FocalLength'] ) ) {
            $meta['focal_length'] = (string) $exif['FocalLength'];
            if ( is_scalar( $exif['FocalLength'] ) ) {
                $meta['focal_length'] = (string) wp_exif_frac2dec( $exif['FocalLength'] );
            }
Home | Imprint | This part of the site doesn't use cookies.