Skip to content

Commit

Permalink
[Bug fixed] Fixed patch memory leak in image caching during image tra…
Browse files Browse the repository at this point in the history
…nsitions (#594)
  • Loading branch information
CVHub520 committed Aug 29, 2024
1 parent 6a0b69f commit 5c498c2
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions anylabeling/views/labeling/widgets/brightness_contrast_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

import PIL.Image
import PIL.ImageEnhance
from PyQt5 import QtWidgets, QtGui
from PyQt5 import QtWidgets
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QImage

from .. import utils
from ..utils.image import pil_to_qimage


Expand All @@ -18,10 +16,6 @@ def __init__(self, img, callback, parent=None):
self.setModal(True)
self.setWindowTitle(self.tr("Brightness/Contrast"))

self.img = img
self.original_img = img.copy()
self.callback = callback

# Brightness slider and label
self.slider_brightness = self._create_slider()
self.brightness_label = QtWidgets.QLabel(
Expand Down Expand Up @@ -75,6 +69,8 @@ def __init__(self, img, callback, parent=None):
self.setLayout(main_layout)

assert isinstance(img, PIL.Image.Image)
self.img = img
self.callback = callback

def update_brightness_label(self, value):
"""Update brightness label"""
Expand Down Expand Up @@ -104,7 +100,6 @@ def reset_values(self):
"""Reset sliders to default values"""
self.slider_brightness.setValue(50)
self.slider_contrast.setValue(50)
self.img = self.original_img.copy()
self.on_new_value()

def confirm_values(self):
Expand Down

0 comments on commit 5c498c2

Please sign in to comment.