• Resolved joshmoto

    (@joshmoto)


    Nice plugin btw, prefer it to ACF: Image Crop Add-on. I like how you return the array in full and some ?? …plus the UI is better.

    I’m having image processor issues. Our server setting is set to GD because other sites on the server need it because we were having issues with Imagick. Memory consumption and larger uploads fail when using Imagick.

    But on my current project I need Imagick because GD seems to be zapping the colour out of my images. See the example here.

    So I’m using ImageMagick Engine plugin which solves the colour issue when adding images to the media library. All the necessary settings are set so all custom image sizes are targeting and use Imagick now. Great.

    But when using Image Aspect Ratio Crop Field it seems to revert back to the GD image processor rather than abiding the ImageMagick Engine plugin rules.

    This is an example image I’m having colour issues with below:

    https://dev.joshmoto.wtf/red-calipers-with-discs.jpg

    Dimensions: 6000px x 4000px
    RGB Color Profile: sRGB ICE61966-2.1

    More on my Imagick vs GD problem.

    Any ideas would be great thank you.

    • This topic was modified 4 years, 11 months ago by joshmoto.
    • This topic was modified 4 years, 11 months ago by joshmoto.
    • This topic was modified 4 years, 11 months ago by joshmoto.
    • This topic was modified 4 years, 11 months ago by joshmoto.
    • This topic was modified 4 years, 11 months ago by joshmoto.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author joppuyo

    (@joppuyo)

    Hey, this plugin uses whatever editor WP uses, this is by default gd, imagick if it’s installed.

    This is defined with the wp_image_editors filter, here’s an example of a new image processing library integration I have created.

    It seems like your plugin does not use this filter and hooks directly in the image upload, maybe the plugin was created before this filter was implemented?

    The root cause of your issue seems that the image you are uploading is in ProPhoto color space instead of sRGB

    identify -verbose red-calipers-with-discs.jpg | grep icc -i
        icc:copyright: Copyright (c) Eastman Kodak Company, 1999, all rights reserved.
        icc:description: ProPhoto RGB
        icc:manufacturer: KODAK
        icc:model: Reference Output Medium Metric(ROMM)  
        Profile-icc: 940 bytes
    

    This is entirely by chance but I have actually written a plugin that fixes color space issues by converting any other color space images into sRGB.

    That plugin, however, does need imagick in order to convert the color space so we are back to square one.

    It looks like the plugin you use is able to work without php imagick extension since it can execute the convert binary directly. That’s why it’s working with resizing (by directly hooking into the filter and executing convert directly) but not cropping.

    I would recommend you to install the imagick php extension and uninstall the plugin. Once the imagick php extension is installed, WordPress will natively support imagick in all operations: image resizing and cropping.

    • This reply was modified 4 years, 11 months ago by joppuyo.
    Thread Starter joshmoto

    (@joshmoto)

    Thank you dude your insight really helpful.

    Just as I thought your plugin is reverting to the server image processing library.

    Is it possible to have both image processors (Imagick and GD) running on the server at the same time, and then defining wp_image_editors in the wp-config or something? To force evoke Imagick.

    The problem we have a lot of other WordPress sites on the server that require GD because Imagick was eating memory and causing uploads to fail when users were hammering uploads at the same time .

    I see you color conversion plugin has a fatal error, i’m guessing because it can’t find Imagick. Pretty awesome, if only I had Imagick on server :-/

    Fatal error: Uncaught Error: Class 'Puc_v4_Factory' not found in /sites/dev.jostmoto.wtf/wp-content/plugins/color-space-fixer-master/functions.php:19 Stack trace: #0 /sites/dev.jostmoto.wtf/wp-admin/includes/plugin.php(2222): include() #1 /sites/dev.jostmoto.wtf/wp-admin/plugins.php(175): plugin_sandbox_scrape('color-space-fix...') #2 {main} thrown in /sites/dev.jostmoto.wtf/wp-content/plugins/color-space-fixer-master/functions.php on line 19

    • This reply was modified 4 years, 11 months ago by joshmoto.
    • This reply was modified 4 years, 11 months ago by joshmoto.
    • This reply was modified 4 years, 11 months ago by joshmoto.
    Thread Starter joshmoto

    (@joshmoto)

    Actually I get the same fatal error on the Color Space plugin on my local environment too which is running Imagick.

    Plugin Author joppuyo

    (@joppuyo)

    Are you sure you have installed the imagick php extension? It’s possible to install imagemagick from your package manager and have the various command line tools like identify and convert but php/WordPress doesn’t know anything about them untill install the php imagick extension.

    I think you could install imagick php extension and my color space fixer plugin and then use the wp_image_editor hook to force WP to use gd even if you have imagick installed. Color space fixer does not use the wp image editor but imagick directly.

    This way you could convert the color space using imagick and do the resizing using gd.

    Plugin Author joppuyo

    (@joppuyo)

    Plugin Author joppuyo

    (@joppuyo)

    One more thing: if you are getting fatal errors, that’s probably because you are missing some files. I recommend to download thr plugin on the github releases page instead of cloning the repo to make sure all dependencies are included.

    Thread Starter joshmoto

    (@joshmoto)

    Thanks again for you quick support.

    The issue is the guy who I host my sites on his server doesn’t want to install Imagick because of the issues he gets on his WordPress sites.

    I know we can force GD on his sites using wp_image_editors filter but he’s not really up for doing that. Which is shame for me because I’ll never be able to get the Imagick results I want.

    Kinda means I need to resort to converting images prior to upload ??

    Anyway cheers for your help, a little off topic in the end but mark this as solved. Nice one.

    Plugin Author joppuyo

    (@joppuyo)

    Hey,

    Too bad there was no easy way to resolve your situation.

    I might have to implement an option to use a command-line tool like convert in jpegicc in my color space fixer plugin so it works without imagick php extension.

    That being said, having imagemagick installed without the php extension is a very uncommon situation and I think not a lot of people will have a similar issue.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Is Imagick or GD being used?’ is closed to new replies.