diff --git a/hgdriver/hgdev/image_process.cpp b/hgdriver/hgdev/image_process.cpp index bc250cc..6522e99 100644 --- a/hgdriver/hgdev/image_process.cpp +++ b/hgdriver/hgdev/image_process.cpp @@ -1336,12 +1336,22 @@ namespace hg_imgproc { // MSB word[7] and word[8] are x and y resolutions std::vector cpr; + unsigned short jpeg_r = (resolution << 8) | ((resolution >> 8) & 0x0ff); cpr.push_back(CV_IMWRITE_JPEG_QUALITY); cpr.push_back((int)(long)conv->dst.fmt.detail); - cpr.push_back(CV_IMWRITE_JPEG_RST_INTERVAL); - cpr.push_back(resolution); if (conv->dst.is_file) + { cv::imwrite(conv->dst.data, imsg, cpr); + + //FILE* f = fopen(conv->dst.data, "rb+"); + //if (f) + //{ + // fseek(f, 0x0e, SEEK_SET); + // fwrite(&jpeg_r, sizeof(jpeg_r), 1, f); + // fwrite(&jpeg_r, sizeof(jpeg_r), 1, f); + // fclose(f); + //} + } else { std::string tmpf(hg_log::temporary_path() + PATH_SEPARATOR + "imgtrans.tmp"); @@ -1350,6 +1360,8 @@ namespace hg_imgproc conv->dst.data = (SANE_String_Const)G4Tiff::load_mini_file(tmpf.c_str(), &bytes, allocate_memory); conv->dst.data_len = bytes; remove(tmpf.c_str()); + //if (conv->dst.data_len > 0x20) + // ((unsigned short*)conv->dst.data)[7] = ((unsigned short*)conv->dst.data)[8] = jpeg_r; } } else if (conv->dst.fmt.compress.compression == SANE_COMPRESSION_GROUP4)