[wp-trac] [WordPress Trac] #43226: Crop setting in thumbnails never set when uploading PDF files

WordPress Trac noreply at wordpress.org
Wed Mar 7 00:15:50 UTC 2018


#43226: Crop setting in thumbnails never set when uploading PDF files
-------------------------------------------------+-------------------------
 Reporter:  leemon                               |       Owner:
     Type:  defect (bug)                         |  mikeschroder
 Priority:  normal                               |      Status:  assigned
Component:  Media                                |   Milestone:  4.9.5
 Severity:  normal                               |     Version:  4.7
 Keywords:  has-patch has-unit-tests 2nd-        |  Resolution:
  opinion dev-feedback                           |     Focuses:
                                                 |  administration
-------------------------------------------------+-------------------------

Comment (by birgire):

 I tested [attachment:43226.diff] and [attachment:43226-unit-test.diff] but
 the unit-test failed.

 It ran successfully when I changed:


 {{{
 'medium'    => array(
         'file'      => 'wordpress-gsoc-flyer-pdf-232x300.jpg',
         'width'     => 300,
         'height'    => 300,
         'mime-type' => 'image/jpeg',
 ),

 }}}

 to:

 {{{
 'medium'    => array(
         'file'      => 'wordpress-gsoc-flyer-pdf-300x300.jpg',
         'width'     => 300,
         'height'    => 300,
         'mime-type' => 'image/jpeg',
 ),

 }}}

 Ticket #39975 aims to ''Remove direct calls to {{{'/tmp/'}}} in Unit
 Tests''.

 So [attachment:43226.2.diff] uses {{{get_temp_dir()}}} instead of
 {{{'/tmp/'}}}.

 If we want to use:

 {{{
 $test_file = wp_tempnam( 'wordpress-gsoc-flyer.pdf' );

 }}}

 then we have to deal with files like:

 {{{
 /tmp/wordpress-gsoc-flyer-Y5yoVa.tmp

 }}}

 making it a little more involved to create the {{{$expected}}} array and
 then to unlink the corresponding files.

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


More information about the wp-trac mailing list