pub fn decode_bin_to(
        meme: impl AsRef<Path>,
        dest: impl AsRef<Path>,
    ) -> anyhow::Result<PathBuf> {
        let meme = meme.as_ref();
        let dest = dest.as_ref();
        log::debug!("Creating executable `{}`", dest.display());
        let f = BufWriter::new({
            #[cfg(unix)]
            {
                OpenOptions::new()
                    .write(true)
                    .create(true)
                    .truncate(true)
                    .mode(0o777)
                    .open(dest)?
            }
            #[cfg(windows)]
            {
                OpenOptions::new()
                    .write(true)
                    .create(true)
                    .truncate(true)
                    .open(dest)?
            }
        });
        let output = BufWriter::new(f);
        let input = BufReader::new(File::open(meme)?);
        log::debug!("Decoding meme binary from `{}`", meme.display());
        AppMarkerJpegDecoder::new(input, output, AppMarkerConfig::default())?;
        Ok(dest.to_path_buf())
    }
/// Decodes the binary file from a meme jpeg and writes it as executable to dest
Decodes the binary file from a meme jpeg and writes it as executable to dest
Decodes the binary file from a meme jpeg and writes it as executable to dest
pub fn decode_bin_to(
        meme: impl AsRef<Path>,
        dest: impl AsRef<Path>,
    ) -> anyhow::Result<PathBuf> {
        let meme = meme.as_ref();
        let dest = dest.as_ref();
        log::debug!("Creating executable `{}`", dest.display());
        let f = BufWriter::new({
            #[cfg(unix)]
            {
                OpenOptions::new()
                    .write(true)
                    .create(true)
                    .truncate(true)
                    .mode(0o777)
                    .open(dest)?
            }
            #[cfg(windows)]
            {
                OpenOptions::new()
                    .write(true)
                    .create(true)
                    .truncate(true)
                    .open(dest)?
            }
        });
        let output = BufWriter::new(f);
        let input = BufReader::new(File::open(meme)?);
        log::debug!("Decoding meme binary from `{}`", meme.display());
        AppMarkerJpegDecoder::new(input, output, AppMarkerConfig::default())?;
        Ok(dest.to_path_buf())
    }
pub fn decode_bin_to ( meme : impl AsRef < Path > , dest : impl AsRef < Path > , ) -> anyhow :: Result < PathBuf > { let meme = meme . as_ref ( ) ; let dest = dest . as_ref ( ) ; log :: debug ! ( " " dest display ( ) ) ; let f = BufWriter :: new ( { # [ cfg ( unix ) ] { OpenOptions :: new ( ) . write ( true ) . create ( true ) . truncate ( true ) . mode ( 0o777 ) . open ( dest ) ? } # [ cfg ( windows ) ] { OpenOptions :: new ( ) . write ( true ) . create ( true ) . truncate ( true ) . open ( dest ) ? } } ) ; let output = BufWriter :: new ( f ) ; let input = BufReader :: new ( File :: open ( meme ) ? ) ; log :: debug ! ( " " meme display ( ) ) ; AppMarkerJpegDecoder :: new ( input , output , AppMarkerConfig :: default ( ) ) ? ; Ok ( dest . to_path_buf ( ) ) }
Decodes the binary file from a meme jpeg and writes it as executable to dest
Decodes the binary file from a meme jpeg and writes it as executable to dest
meme
impl AsRef<Path>
dest
impl AsRef<Path>