conflict with imsanity / need way to remove orginals

HomeSupportImage Storeconflict with imsanity / need way to remove orginals

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #53404
    Dave
    Participant

    Hi,

    Previously we used a plugin called Imsanity to reduce the file size of all uploaded images.  Somewhere along the line (in 3.2.9 and 3.2.7, possibly earlier) we discovered a conflict:  After dragging images into the drop-zone to upload, the thumbnails would disappear from the progress list.  Once finished uploading, the correct count would appear, but only one (or none) of the uploaded images appeared in the gallery’s thumbnail list.  On the file system, multiple sizes were created for just that image, and none of the others.

    This problem was resolved by disabling the Imsanity plugin.  All uploading worked; multiple sizes were created; and all thumbnails appeared after upload.

    However, the problem is now that all the original photos are sitting on the server.  They are very large, full quality and take up a lot of space.  The point of using Imsanity is to prevent a huge hit against our storage quota.  And, of course, we don’t want originals up there on the server to be found.

    Is there any way these originals can be removed after uploading?  We have 1024 x 768 set as the Max Size in Image Store Settings > Images.  We don’t want any images bigger than that… anywhere. Can that be enforced on the originals?

    Please advise,

    #53448
    Xpark Media
    Keymaster

    @dave,

    You can create a plugin to remove the images once they are uploaded, we recently did it for one of our clients, modify it as needed.

    function ims_delete_original_image( $metadata, $attachment_id ){
    	if (empty($metadata['file']) || 'ims_image' != get_post_type($attachment_id) )
    		return $metadata;
    
    	if( file_exists( $metadata['file'] ))
    		@unlink( $metadata['file'] );
    	return $metadata;
    } add_filter('wp_generate_attachment_metadata','ims_delete_original_image');
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.