Issue while importing PNG images

This topic is: resolved

 

Thank you for contacting me. Please note that I live in the GMT+3 time zone - responses might be delayed by this.

Tagged: 

This topic has 7 replies, 2 voices, and was last updated 2 years, 1 month ago by Szabi – CodeRevolution.

Viewing 7 reply threads
  • Author
    Posts
    • #5959


      stefano
      Participant
      Post count: 4

      Hello,
      I am importing this feed

      https://decrypt.co/feed

      and I set it to save the featured image locally.

      Whenever it encounters a PNG image, the relative media file in WordPress is broken, and in the error log I have this sequence of warnings and notice messages:

      <div>
      <div>[28-Sep-2022 07:19:18 UTC] PHP Warning:  imagepng(): gd-png error: compression level must be 0 through 9 in /app/wordpress/wp-content/plugins/rss-feed-post-generator-echo/res/ImageResize/ImageResize.php on line 336</div>
      <div>[28-Sep-2022 07:19:19 UTC] PHP Notice:  getimagesize(): Error reading from /app/wordpress/wp-content/uploads/2022/09/334-attachment.jpg! in /app/wordpress/wp-includes/media.php on line 5189</div>
      <div>[28-Sep-2022 07:19:19 UTC] PHP Notice:  exif_imagetype(): Error reading from /app/wordpress/wp-content/uploads/2022/09/334-attachment.jpg! in /app/wordpress/wp-includes/functions.php on line 3265</div>
      </div>

      <div>Can it be fixed?

      Thank you!</div>

    • #5960


      stefano
      Participant
      Post count: 4

      (sorry, I wanted to edit the message and remove the unnecessary <div> tags that got carried over from cut&paste, but it seems I can’t edit)

    • #5961


      stefano
      Participant
      Post count: 4

      If that’s of any help, I am using PHP 8.0.23

    • #5966


      Szabi – CodeRevolution
      Keymaster
      Post count: 4577

      Hello,

      First of all, thank you for your purchase.

      I checked on this, but it is not happening on my test site, png images are also created without issues from the RSS feed you mentioned.

      Can you send me, please, temporary admin login credentials to your WordPress install, so I can check this issue out directly on your site? Send it, please, to my email address: kisded@yahoo.com.

      Regards, Szabi – CodeRevolution.

    • #5967


      stefano
      Participant
      Post count: 4

      Thanks for the reply Szabi!

      Right now the website is on my local dev environment only.
      I will start testing it out on a VPS next week probably, and I will send you the login credentials then.

    • #5968


      Szabi – CodeRevolution
      Keymaster
      Post count: 4577

      Sure.

    • #5990


      stefano
      Participant
      Post count: 4

      Hi, I was able to find what was causing the issue. I guess there is a minor bug. 🙂

      In the main settings I had set the “<b>Featured Image Resize Quality:</b>” setting to 75.
      For some reason, the imagepng function at line 336 of /res/ImageResize/ImageResize.php is using the value of 75, which is invalid in this case.

      Hope that helps!

      Stefano

    • #5999


      Szabi – CodeRevolution
      Keymaster
      Post count: 4577

      Hello,

      I checked and yes, you are right, thank you for pointing this out. I fixed this in the code now, in the upcoming plugin update this will work well even for large values in the ‘Featured Image Resize Quality’ settings field.

      Thank you.

      Regards, Szabi – CodeRevolution.

Viewing 7 reply threads

The topic ‘Issue while importing PNG images’ is closed to new replies.