         if WebPEncode(&config, &picture) == 0 {
             WebPPictureFree(&picture)
 
-            let error = WebPEncodeError(rawValue:  Int(picture.error_code.rawValue))!
-            print("encode error \(error)")
+            let error = WebPEncodeStatusCode(rawValue:  Int(picture.error_code.rawValue))!
             throw error
         }
         WebPPictureFree(&picture)

                        resizeWidth: Int = 0, resizeHeight: Int = 0) throws -> Data {
        var config = config.rawValue
        if WebPValidateConfig(&config) == 0 {
            fatalError("invalid config")
        }

        var picture = WebPPicture()
        if WebPPictureInit(&picture) == 0 {
            fatalError("version error")
        }

        picture.use_argb = config.lossless == 0 ? 0 : 1

        let ok = importer(&picture, dataPtr, Int32(stride))
        if ok == 0 {
            WebPPictureFree(&picture)
            throw WebPEncoderError.versionMismatched
        }

        if resizeHeight > 0 && resizeWidth > 0 {
            if (WebPPictureRescale(&picture, Int32(resizeWidth), Int32(resizeHeight)) == 0) {
                throw WebPEncodeStatusCode.outOfMemory
            }
        }

