Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thanks for this answer.
    Sorry for the delay, holidays etc…

    I’ve checked the parameters and both options are turned on and still it does not work even with the recent update ??

    Thanks for the perfect plugin.
    As a matter of fact I have the same problem with my images uploaded from the frontend with my custom script (even if it uses the WordPress core functions to upload) => there is no watermark added after the post submit.

    Here is the input field :
    <input type="file" name="image[]" id="image"><span class="help-inline">Max up size: 10m</span>

    Here is the function I use (on a page on the frontend) :

    function insert_attachment($file_handler,$post_id,$setthumb='false') {
    	// check to make sure its a successful upload
    	if ($_FILES[$file_handler]['error'] !== UPLOAD_ERR_OK) __return_false();
    
    	require_once(ABSPATH . "wp-admin" . '/includes/image.php');
    	require_once(ABSPATH . "wp-admin" . '/includes/file.php');
    	require_once(ABSPATH . "wp-admin" . '/includes/media.php');
    
    	$attach_id = media_handle_upload( $file_handler, $post_id );
    
    	if (isset($setthumb)) update_post_meta($post_id,'_thumbnail_id',$attach_id);
    	return $attach_id;
    }

    Do I have to insert a call to wp_generate_attachment_metadata as you apply the watermark within thius function ?

    add_filter('wp_generate_attachment_metadata', array(&$this, 'apply_watermark'));

    Thanks for your advice

Viewing 2 replies - 1 through 2 (of 2 total)