getImageProfiles( $name, true ); if ( ! empty( $found[ $name ] ) ) { $icc[ $name ] = $found[ $name ]; } } $image->stripImage(); foreach ( $icc as $name => $data ) { $image->profileImage( $name, $data ); } } catch ( \Exception $e ) { // Better no image than one that still carries the location. return new \WP_Error( 'image_strip_meta_error', $e->getMessage() ); } return true; } }