Skip to content

Commit

Permalink
Use JxlDecoderPtr instead of hand-written unique_ptr
Browse files Browse the repository at this point in the history
Also fix TODO.
  • Loading branch information
qarkai authored and caclark committed Jan 12, 2025
1 parent 97d189c commit db5572c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/image-load-jpegxl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
#include <glib-object.h>
#include <glib.h>
#include <jxl/codestream_header.h>
#include <jxl/decode.h> //TODO Use decode_cxx.h?
#include <jxl/decode_cxx.h>
#include <jxl/types.h>

#include "image-load.h"
Expand Down Expand Up @@ -93,7 +93,7 @@ void free_buffer(guchar *pixels, gpointer)

uint8_t *JxlMemoryToPixels(const uint8_t *next_in, size_t size, size_t &xsize, size_t &ysize, size_t &stride)
{
std::unique_ptr<JxlDecoder, decltype(&JxlDecoderDestroy)> dec{JxlDecoderCreate(nullptr), JxlDecoderDestroy};
JxlDecoderPtr dec = JxlDecoderMake(nullptr);
if (!dec)
{
log_printf("JxlDecoderCreate failed\n");
Expand Down

0 comments on commit db5572c

Please sign in to comment.