/**
  * Save an image
  */
 public function save_image()
 {
     check_ajax_referer(self::NONCE_SAVE_IMAGE, 'nonce');
     $attachment_id = isset($_POST['attachment_id']) ? absint($_POST['attachment_id']) : false;
     if ($this->is_attachment($attachment_id)) {
         // faces
         if (isset($_POST['faces'])) {
             if ($_POST['faces']) {
                 update_post_meta($attachment_id, 'faces', $_POST['faces']);
             } else {
                 delete_post_meta($attachment_id, 'faces');
             }
         }
         // hotspots
         if (isset($_POST['hotspots'])) {
             if ($_POST['hotspots']) {
                 update_post_meta($attachment_id, 'hotspots', $_POST['hotspots']);
             } else {
                 delete_post_meta($attachment_id, 'hotspots');
             }
         }
         // regenerate thumbs
         $resized = MEAUH_Attachment::regenerate($attachment_id);
         if ($resized) {
             wp_send_json_success(array('resized' => $resized));
         }
     } else {
         wp_send_json_error();
     }
 }
         * Get cropped sizes
         *
         * @return array
         */
        protected static function get_cropped_sizes()
        {
            global $_wp_additional_image_sizes;
            $sizes = array();
            $size_names = get_intermediate_image_sizes();
            foreach ($size_names as $size) {
                if (in_array($size, array('thumbnail', 'medium', 'large'))) {
                    $width = intval(get_option($size . '_size_w'));
                    $height = intval(get_option($size . '_size_h'));
                    $crop = get_option($size . '_crop');
                } else {
                    if (isset($_wp_additional_image_sizes[$size])) {
                        $width = $_wp_additional_image_sizes[$size]['width'];
                        $height = $_wp_additional_image_sizes[$size]['height'];
                        $crop = $_wp_additional_image_sizes[$size]['crop'];
                    }
                }
                if ($crop) {
                    $sizes[$size] = array('width' => $width, 'height' => $height, 'crop' => $crop);
                }
            }
            return $sizes;
        }
    }
}
MEAUH_Attachment::init();