Skip to content

Commit 6b9fd46

Browse files
committed
verbose trace printf removed
1 parent faa1848 commit 6b9fd46

2 files changed

Lines changed: 3 additions & 39 deletions

File tree

src/pillow_avif/AvifImagePlugin.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,6 @@ def _save(im, fp, filename, save_all=False):
227227
frame = ims
228228
rawmode = ims.mode
229229

230-
print("AvifImagePlugin.py _save rawmode={0}".format(rawmode))
231-
232230
if ims.mode not in _VALID_AVIF_MODES:
233231

234232
print("AvifImagePlugin.py _save ims.mode is not valid avif mode. converting. {0}".format(ims.mode))
@@ -249,8 +247,6 @@ def _save(im, fp, filename, save_all=False):
249247

250248
# Append the frame to the animation encoder
251249

252-
print("AvifImagePlugin.py _save enc.add start")
253-
254250
enc.add(
255251
frame.tobytes("raw", rawmode),
256252
frame_dur,
@@ -260,8 +256,6 @@ def _save(im, fp, filename, save_all=False):
260256
is_single_frame,
261257
)
262258

263-
print("AvifImagePlugin.py _save enc.add end")
264-
265259
# Update frame index
266260
frame_idx += 1
267261

@@ -278,8 +272,6 @@ def _save(im, fp, filename, save_all=False):
278272

279273
fp.write(data)
280274

281-
print("AvifImagePlugin.py _save end.")
282-
283275

284276
Image.register_open(AvifImageFile.format, AvifImageFile, _accept)
285277
if SUPPORTED:

src/pillow_avif/_avif.c

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,6 @@ AvifEncoderNew(PyObject *self_, PyObject *args) {
202202
AvifEncoderObject *self = NULL;
203203
avifEncoder *encoder = NULL;
204204

205-
printf("%s:%d AvifEncoderNew\n", __FILE__, __LINE__);
206-
207205
char *subsampling = "4:2:0";
208206
int qmin = AVIF_QUANTIZER_BEST_QUALITY; // =0
209207
int qmax = 10; // "High Quality", but not lossless
@@ -348,24 +346,6 @@ AvifEncoderNew(PyObject *self_, PyObject *args) {
348346
_add_codec_specific_options(encoder, advanced);
349347
#endif
350348

351-
printf(
352-
" maxT=%d qmin=%d qmax=%d codec=%d speed=%d yuvRange=%d subsampling=%d "
353-
"color_primaries=%d transferCharacteristics=%d matrix_coefficients=%d "
354-
"width=%d height=%d depth=%d\n",
355-
max_threads,
356-
enc_options.qmin,
357-
enc_options.qmax,
358-
(int)enc_options.codec,
359-
enc_options.speed,
360-
(int)enc_options.range,
361-
(int)enc_options.subsampling,
362-
color_primaries,
363-
transfer_characteristics,
364-
matrix_coefficients,
365-
width,
366-
height,
367-
depth);
368-
369349
self->encoder = encoder;
370350

371351
avifImage *image = avifImageCreateEmpty();
@@ -451,8 +431,6 @@ _encoder_add(AvifEncoderObject *self, PyObject *args) {
451431
avifImage *image = self->image;
452432
avifImage *frame = NULL;
453433

454-
printf("%s:%d _encoder_add\n", __FILE__, __LINE__);
455-
456434
if (!PyArg_ParseTuple(
457435
args,
458436
"z#IIIsO",
@@ -505,19 +483,18 @@ _encoder_add(AvifEncoderObject *self, PyObject *args) {
505483
rgb.depth = self->image->depth;
506484

507485
if (strcmp(mode, "RGBA") == 0) {
508-
printf("%s:%d mode=%s\n", __FILE__, __LINE__, mode);
509486
rgb.format = AVIF_RGB_FORMAT_RGBA;
510487
channels = 4;
488+
} else if (strcmp(mode, "R16G16B16") == 0) {
489+
rgb.format = AVIF_RGB_FORMAT_RGB;
490+
channels = 3;
511491
} else {
512-
printf("%s:%d mode=%s\n", __FILE__, __LINE__, mode);
513492
rgb.format = AVIF_RGB_FORMAT_RGB;
514493
channels = 3;
515494
}
516495

517496
avifRGBImageAllocatePixels(&rgb);
518497

519-
printf(" rgb.rowBytes=%u rgb.height=%u size=%d\n", rgb.rowBytes, rgb.height, (int)size);
520-
521498
if (rgb.rowBytes * rgb.height != size) {
522499
printf("%s:%d\n", __FILE__, __LINE__);
523500
PyErr_Format(
@@ -575,7 +552,6 @@ _encoder_add(AvifEncoderObject *self, PyObject *args) {
575552

576553
uint32_t addImageFlags = AVIF_ADD_IMAGE_FLAG_NONE;
577554
if (PyObject_IsTrue(is_single_frame)) {
578-
printf("%s:%d\n", __FILE__, __LINE__);
579555
addImageFlags |= AVIF_ADD_IMAGE_FLAG_SINGLE;
580556
}
581557

@@ -594,15 +570,13 @@ _encoder_add(AvifEncoderObject *self, PyObject *args) {
594570
}
595571

596572
end:
597-
printf("%s:%d\n", __FILE__, __LINE__);
598573
avifRGBImageFreePixels(&rgb);
599574
if (!is_first_frame) {
600575
printf("%s:%d\n", __FILE__, __LINE__);
601576
avifImageDestroy(frame);
602577
}
603578

604579
if (ret == Py_None) {
605-
printf("%s:%d _encoder_add success. frame_index=%d\n", __FILE__, __LINE__, self->frame_index);
606580
self->frame_index++;
607581
Py_RETURN_NONE;
608582
} else {
@@ -615,8 +589,6 @@ PyObject *
615589
_encoder_finish(AvifEncoderObject *self) {
616590
avifEncoder *encoder = self->encoder;
617591

618-
printf("%s:%d _encoder_finish\n", __FILE__, __LINE__);
619-
620592
avifRWData raw = AVIF_DATA_EMPTY;
621593
avifResult result;
622594
PyObject *ret = NULL;

0 commit comments

Comments
 (0)