gfx_jpeg_codec.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. diff -Naur orig/ui/gfx/codec/jpeg_codec.cc patched/ui/gfx/codec/jpeg_codec.cc
  2. --- orig/ui/gfx/codec/jpeg_codec.cc 2016-04-24 21:31:31.000000000 +0200
  3. +++ patched/ui/gfx/codec/jpeg_codec.cc 2016-06-13 23:43:36.809948082 +0200
  4. @@ -120,7 +120,7 @@
  5. // tell libjpeg where to write the next data
  6. cinfo->dest->next_output_byte = &(*state->out)[state->image_buffer_used];
  7. cinfo->dest->free_in_buffer = state->out->size() - state->image_buffer_used;
  8. - return 1;
  9. + return TRUE;
  10. }
  11. // Cleans up the JpegEncoderState to prepare for returning in the final form.
  12. @@ -266,7 +266,7 @@
  13. cinfo.data_precision = 8;
  14. jpeg_set_defaults(&cinfo);
  15. - jpeg_set_quality(&cinfo, quality, 1); // quality here is 0-100
  16. + jpeg_set_quality(&cinfo, quality, TRUE); // quality here is 0-100
  17. // set up the destination manager
  18. jpeg_destination_mgr destmgr;
  19. @@ -278,7 +278,7 @@
  20. JpegEncoderState state(output);
  21. cinfo.client_data = &state;
  22. - jpeg_start_compress(&cinfo, 1);
  23. + jpeg_start_compress(&cinfo, TRUE);
  24. // feed it the rows, doing necessary conversions for the color format
  25. #ifdef JCS_EXTENSIONS
  26. @@ -364,7 +364,7 @@
  27. // set to a positive value if TRUE is returned. A FALSE return should only
  28. // be used when I/O suspension is desired."
  29. boolean FillInputBuffer(j_decompress_ptr cinfo) {
  30. - return false;
  31. + return FALSE;
  32. }
  33. // Skip data in the buffer. Since we have all the data at once, this operation
  34. @@ -496,7 +496,7 @@
  35. cinfo.client_data = &state;
  36. // fill the file metadata into our buffer
  37. - if (jpeg_read_header(&cinfo, true) != JPEG_HEADER_OK)
  38. + if (jpeg_read_header(&cinfo, TRUE) != JPEG_HEADER_OK)
  39. return false;
  40. // we want to always get RGB data out