[wp-trac] [WordPress Trac] #48204: wp_exif_date2ts throws notice on empty date

WordPress Trac noreply at wordpress.org
Thu Jun 29 01:45:04 UTC 2023


#48204: wp_exif_date2ts throws notice on empty date
--------------------------+-----------------------------
 Reporter:  nosilver4u    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Date/Time     |     Version:  5.2.3
 Severity:  minor         |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------------

Comment (by tmatsuur):

 I too was in the process of importing data from another site and some
 image files were showing warning errors.

 The contents of the DateTimeDigitized item in the corresponding file had
 the following three patterns.

 {{{
 1. string(1) " "
 2. string(19) "    :  :     :  :  "
 3. string(19) "2017/07/02 17:26:46"
 }}}

 I was able to confirm the first and second patterns in the specifications,
 but not the third.

 As for the first, there may be a way to change the side that calls the
 wp_exif_date2ts().

 {{{
 if ( empty( $meta['created_timestamp'] ) && ! empty( trim(
 $exif['DateTimeDigitized'] ) ) ) {
         $meta['created_timestamp'] = wp_exif_date2ts(
 $exif['DateTimeDigitized'] );
 }
 }}}

 In the above, the DateTimeDigitized item is trimmed before determining if
 it is empty.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48204#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list