pub fn to_data_url(
        &self,
        media_type: &str,
        quality: ImageQuality,
    ) -> Result<String, SecurityError> {
        let quality: f64 = quality.into();

        self.inner
            .to_data_url_with_type_and_encoder_options(media_type, &quality.into())
            .map_err(|err| SecurityError::new(err.unchecked_into()))
    }
// TODO: it's unclear from the WHATWG spec if there can also be an encoding error, or if that
// would only result in an empty string, needs to be experimented with.
it's unclear from the WHATWG spec if there can also be an encoding error, or if that
would only result in an empty string, needs to be experimented with.
it ' s unclear from the WHATWG spec if there can also be an encoding error or if that would only result in an empty string needs to be experimented with .
pub fn to_data_url(
        &self,
        media_type: &str,
        quality: ImageQuality,
    ) -> Result<String, SecurityError> {
        let quality: f64 = quality.into();
        self.inner
            .to_data_url_with_type_and_encoder_options(media_type, &quality.into())
            .map_err(|err| SecurityError::new(err.unchecked_into()))
    }
pub fn to_data_url ( & self , media_type : & str , quality : ImageQuality , ) -> Result < String , SecurityError > { let quality : f64 = quality . into ( ) ; self . inner . to_data_url_with_type_and_encoder_options ( media_type , & quality . into ( ) ) . map_err ( | err | SecurityError :: new ( err . unchecked_into ( ) ) ) }
TODO: it's unclear from the WHATWG spec if there can also be an encoding error, or if that
would only result in an empty string, needs to be experimented with.
TODO : it ' s unclear from the WHATWG spec if there can also be an encoding error or if that would only result in an empty string needs to be experimented with .
&self
media_type
&str
quality
ImageQuality
&self
media_type
&str
quality
ImageQuality