• Resolved mastmast

    (@mastmast)


    Hello,

    Does your plugin provide any function that I could use to pass my file path /home/….jpg and resize it?

    for example

    imsanity_custom_resize($filename);

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter mastmast

    (@mastmast)

    nevermind found 🙂
    Thanks for the awesome function

    /**
     * Resize an image using the WP_Image_Editor.
     *
     * @param string $file Image file path.
     * @param int    $max_w Maximum width to resize to.
     * @param int    $max_h Maximum height to resize to.
     * @param bool   $crop Optional. Whether to crop image or resize.
     * @param string $suffix Optional. File suffix.
     * @param string $dest_path Optional. New image file path.
     * @param int    $jpeg_quality Optional, default is 82. Image quality level (1-100).
     * @return mixed WP_Error on failure. String with new destination path.
     */
    imsanity_image_resize( $file, $max_w, $max_h, $crop = false, $suffix = null, $dest_path = null, $jpeg_quality = 82 )
    Plugin Author nosilver4u

    (@nosilver4u)

    That’s the one, glad you found it!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Available function to resize’ is closed to new replies.