I'm getting scale = None with this and it shouldn't scale = Scale.\_\_members\_\_.get(second\_half\_scale, None) if second\_half\_scale in scale\_mapping else None
. Here is the code, scale\_mapping = {
 "0.5x": Scale.X05,
 "2x": Scale.X2,
 "4x": Scale.X4,
 "6x": Scale.X6,
 } and def get\_gigapixel\_setting(self, tag):
 self.error("get\_gigapixel\_setting: "+tag)
 split\_list = tag.split(":")
 first\_half\_mode = split\_list[0]
 second\_half\_scale = split\_list[1]
 # Change to Enum Values
 # first\_half\_mode = mode\_mapping[first\_half\_mode]
 # second\_half\_scale = scale\_mapping[second\_half\_scale]

 self.error("first\_half\_mode: "+str(first\_half\_mode))
 self.error("second\_half\_scale: "+str(second\_half\_scale))

 mode = Mode.\_\_members\_\_.get(first\_half\_mode, None) if first\_half\_mode in scale\_mapping else None

 scale = Scale.\_\_members\_\_.get(second\_half\_scale, None) if second\_half\_scale in scale\_mapping else None
 
 self.error("scale: "+str(scale))
 # if not scale:
 # self.error("No scale setting found")
 # continue
 # scale = scale\_mapping.get(first\_half\_mode, None)
 # self.error("scale: "+str(scale))

 # if not scale:
 # self.debug("No scale setting in tags, Removing tag: "+tag)
 return mode, scale and def process\_performer\_image(self, app, performer, tag\_names):
 performer\_id = performer[0] # Initialize performer\_id here
 performer\_name = performer[1]
 tags = self.findPerformersTagsbyID(performer\_name)
 self.check\_performer\_tagged\_once(tags, tag\_names)
 self.check\_tags\_not\_empty(tags)
 for tag in tags:
 if tag != "Upscaled: Performer Image" and tag in tag\_names:
 self.error("if tag in tag\_names: "+tag)
 tag = tag.replace("Upscale ", "")
 self.get\_gigapixel\_setting(tag)
 performer\_id = performer[1]
 image\_path = performer[0]
 self.error("image\_path: "+image\_path)
 self.error("performer\_id: "+performer\_id)
 self.error("second\_half\_scale: "+str(mode))
 self.error("first\_half\_mode: "+str(scale))
 self.processPerformerImage(
 app, image\_path, performer\_id, mode, scale) and def processPerformerImage(self, app, image\_path, performer\_id, mode, scale):
 global tag\_ids
 global app\_keys
 tag\_ids = []

 # Set current directory
 current\_dir = Path().resolve()

 # Get Enum Settings
 # if first\_half\_mode is not None:
 # scale = Scale.\_\_getattr\_\_(second\_half\_scale)
 # else:
 # self.error("No scale setting found")
 # if first\_half\_mode is not None:
 # mode = Mode.\_\_getattr\_\_(second\_half\_mode)
 # else:
 # self.error("No mode setting found")

 try:
 r = requests.get(image\_path, stream=True, headers=self.headers)
 r.raise\_for\_status()
 r.raw.decode\_content = True
 img = Image.open(BytesIO(r.content))
 file\_format = img.format.lower()
 if file\_format not in IMAGE\_TYPES:
 self.error(
 "file\_format not in IMAGE\_TYPES: converting to JPEG")
 img = img.convert('RGB')
 # Variable for saved image
 file\_format = 'jpeg'
 image\_name = "image\_to\_process." + file\_format
 self.error("file\_format\_new\_saved: "+file\_format)

 # Check if image already exists
 image\_saved = current\_dir / image\_name
 if os.path.exists(image\_saved):
 self.delete\_file\_with\_permissions\_check(image\_saved)

 img.save(image\_name, format='JPEG', quality=90)
 except requests.exceptions.RequestException as e:
 self.error(
 "An error occurred while trying to download the image:{}".format(e))
 return
 except Exception as e:
 self.error(
 "An error occurred while trying to convert the image:{}".format(e))
 return

 # Variable for saved image
 self.error("file\_format: "+file\_format)

 image\_name = "image\_to\_process." + file\_format
 image\_saved = current\_dir / image\_name

 self.error("image\_saved: "+str(image\_saved))

 # Check if original image already exists in root & delete
 if os.path.exists(image\_saved):
 # os.remove(image\_saved)
 self.delete\_file\_with\_permissions\_check(image\_saved)

 # Check if processed image already exists in root & delete
 split\_image = image\_name.split(".")
 image\_name = split\_image[0]
 file\_ext = split\_image[1]
 image\_pro = image\_name + OUTPUT\_SUFFIX + "." + file\_ext
 image\_pro\_resolve = os.path.join(current\_dir, image\_pro)
 if os.path.exists(image\_pro\_resolve):
 # os.remove(image\_pro\_resolve)
 self.delete\_file\_with\_permissions\_check(image\_pro\_resolve)

 # Check if processed image already exists in mapped folder & delete
 custom\_mapped\_folder\_resolve = os.path.join(
 CUSTOM\_MAPPED\_FOLDER, image\_pro)
 if os.path.exists(custom\_mapped\_folder\_resolve):
 # os.remove(custom\_mapped\_folder\_resolve)
 self.delete\_file\_with\_permissions\_check(
 custom\_mapped\_folder\_resolve)

 # Save image
 with open(image\_saved, 'wb') as f:
 img.save(f, "JPEG", quality=95, optimize=True)

 self.error("image\_saved: "+str(image\_saved))

 # Process the image
 output\_path = app.process(image\_saved, scale=scale, mode=mode)

 # clear the image
 app.send\_keys\_clear()
 # move the processed image to custom mapped folder
 image\_moved = shutil.move(output\_path, CUSTOM\_MAPPED\_FOLDER)
 self.error("image\_moved: "+str(image\_moved))

 # Upload URL of image
 image\_upload\_url = CUSTOM\_MAPPED\_URL + "/" + image\_pro
 self.error("image\_upload\_url: "+str(image\_upload\_url))

 with open(image\_upload\_url, "rb") as image\_file:
 encoded\_string = base64.b64encode(
 image\_file.read()).decode("utf-8")
 data\_url = f"data:image/jpeg;base64,{encoded\_string}"

 # Update performer with new image
 query = """
 mutation performerUpdate($performer\_update\_input: PerformerUpdateInput!){
 performerUpdate(input: $performer\_update\_input){
 id
 image\_path
 }
 }
 """
 variables = {"performer\_update\_input": {
 "id": performer\_id, "image": data\_url}}
 result = self.\_\_callGraphQL(query, variables)

 # Update Performer Tags
 tags = self.findPerformersTagsbyID(performer\_id)
 tag\_to\_remove = "Upscale " + str(mode) + ":" + str(scale)
 self.error("tag\_to\_remove: "+tag\_to\_remove)
 for tag in tags:
 if tag\_to\_remove not in tag:
 tag\_ids.append(self.findTagIdWithName(tag))
 self.error("tag\_ids: "+str(tag\_ids))
 else:
 pass # The else block does nothing

 upscaled\_name = "Upscaled: Performer Image"
 upscaled = self.findTagIdWithName(upscaled\_name)
 tag\_ids.append(upscaled)
 # remove the marker value
 self.error("tag\_ids + upscaled: "+str(tag\_ids))
 self.updatePerformerIDTagsWithID(performer\_id, tag\_ids)

 # Delete the processed image
 custom\_mapped\_folder\_resolve = os.path.join(
 CUSTOM\_MAPPED\_FOLDER, image\_pro)
스케일 = None을 얻고 있는데 스케일 = Scale.\_\_members\_\_.get(second\_half\_scale, None) if second\_half\_scale in scale\_mapping else None
. 다음은 코드입니다. scale\_mapping = {
 "0.5x": Scale.X05,
 "2x": Scale.X2,
 "4x": Scale.X4,
 "6x": Scale.X6,
 } 및 def get\_gigapixel\_setting(self, tag):
 self.error("get\_gigapixel\_setting:"+tag)
 split\_list = tag.split(":")
 first\_half\_mode = split\_list[0]
 second\_half\_scale = split\_list[1]
 # 열거형 값으로 변경
 # 첫 번째\_하프\_모드 = 모드\_맵핑[첫 번째\_하프\_모드]
 # second\_half\_scale = scale\_mapping[second\_half\_scale]

 self.error("first\_half\_mode: "+str(first\_half\_mode))
 self.error("second\_half\_scale: "+str(second\_half\_scale))

 mode = Mode.\_\_members\_\_.get(first\_half\_mode, None) if first\_half\_mode in scale\_mapping else None

 scale = Scale.\_\_members\_\_.get(second\_half\_scale, None) if second\_half\_scale in scale\_mapping else None
 
 self.error("scale: "+str(scale))
 # 스케일이 없으면
 # self.error("스케일 설정이 없습니다")
 # 계속
 # scale = scale\_mapping.get(first\_half\_mode, None)
 # self.error("scale: "+str(scale))

 # 스케일이 아닌 경우:
 # self.debug("태그에 스케일 설정 없음, 태그 제거 중:"+tag)
 반환 모드, 스케일 및 정의 프로세스\_퍼포머\_이미지(self, 앱, 퍼포머, 태그\_이름):
 performer\_id = performer[0] # 여기서 performer\_id를 초기화합니다.
 performer\_name = performer[1]
 tags = self.findPerformersTagsbyID(performer\_name)
 self.check\_performer\_tagged\_once(tags, tag\_names)
 self.check\_tags\_not\_empty(tags)
 태그의 태그에 대해:
 if tag != "업스케일: 출연자 이미지" 및 tag\_names의 태그:
 self.error("태그가 태그\_이름에 있으면:"+태그)
 tag = tag.replace("업스케일", "")
 self.get\_기가픽셀\_설정(태그)
 performer\_id = performer[1]
 image\_path = performer[0]
 self.error("이미지\_경로:"+이미지\_경로)
 self.error("performer\_id:"+performer\_id)
 self.error("second\_half\_scale: "+str(mode))
 self.error("first\_half\_mode: "+str(scale))
 self.processPerformerImage(
 app, image\_path, performer\_id, mode, scale) 및 def processPerformerImage(self, app, image\_path, performer\_id, mode, scale):
 글로벌 태그\_ids
 글로벌 앱\_키
 tag\_ids = []

 # 현재 디렉토리 설정
 current\_dir = Path().resolve()

 # 열거형 설정 가져오기
 # 첫 번째\_하프\_mode가 None이 아닌 경우:
 # scale = Scale.\_\_getattr\_\_(second\_half\_scale)
 # else:
 # self.error("스케일 설정이 없습니다")
 # 첫 번째\_하프\_모드가 None이 아닌 경우:
 # mode = Mode.\_\_getattr\_\_(second\_half\_mode)
 # else:
 # self.error("모드 설정이 없습니다")

 try:
 r = requests.get(image\_path, stream=True, headers=self.headers)
 r.raise\_for\_status()
 r.raw.decode\_content = True
 img = Image.open(BytesIO(r.content))
 file\_format = img.format.lower()
 파일\_형식이 이미지\_타입에 없으면:
 self.error(
 "파일\_형식이 IMAGE\_TYPES에 없음: JPEG로 변환 중")
 img = img.convert('RGB')
 # 저장된 이미지에 대한 변수
 file\_format = 'jpeg'
 이미지\_이름 = "이미지\_투\_프로세스." + 파일\_형식
 self.error("파일\_형식\_새로운\_saved:"+파일\_형식)

 # 이미지가 이미 존재하는지 확인
 image\_saved = 현재\_dir/이미지\_이름
 if os.path.exists(image\_saved):
 self.delete\_file\_with\_permissions\_check(image\_saved)

 img.save(이미지\_이름, 형식='JPEG', 품질=90)
 요청.예외.요청 예외를 e로 제외합니다:
 self.error(
 "이미지를 다운로드하는 동안 오류가 발생했습니다:{}".format(e))
 반환
 예외를 e로 제외합니다:
 self.error(
 "이미지를 변환하는 동안 오류가 발생했습니다:{}".format(e))
 반환

 # 저장된 이미지에 대한 변수
 self.error("파일\_형식:"+파일\_형식)

 이미지\_이름 = "이미지\_to\_프로세스." + 파일\_형식
 image\_saved = 현재\_dir/이미지\_이름

 self.error("image\_saved: "+str(image\_saved))

 # 원본 이미지가 루트에 이미 존재하는지 확인 후 삭제
 os.path.exists(image\_saved):
 # os.remove(image\_saved)
 self.delete\_file\_with\_permissions\_check(image\_saved)

 # 처리된 이미지가 이미 루트에 있는지 확인하고 삭제합니다.
 split\_image = image\_name.split(".")
 image\_name = split\_image[0]
 file\_ext = split\_image[1]
 image\_pro = image\_name + OUTPUT\_SUFFIX + "." + 파일\_ext
 image\_pro\_resolve = os.path.join(current\_dir, image\_pro)
 if os.path.exists(image\_pro\_resolve):
 # os.remove(image\_pro\_resolve)
 self.delete\_file\_with\_permissions\_check(image\_pro\_resolve)

 # 처리된 이미지가 매핑된 폴더에 이미 있는지 확인하고 삭제합니다.
 custom\_mapped\_folder\_resolve = os.path.join(
 CUSTOM\_MAPPED\_FOLDER, image\_pro)
 if os.path.exists(custom\_mapped\_folder\_resolve):
 # os.remove(custom\_mapped\_folder\_resolve)
 self.delete\_file\_with\_permissions\_check(
 custom\_mapped\_folder\_resolve)

 # 이미지 저장
 with open(image\_saved, 'wb') as f:
 img.save(f, "JPEG", quality=95, optimize=True)

 self.error("image\_saved: "+str(image\_saved))

 # 이미지 처리
 output\_path = app.process(image\_saved, scale=scale, mode=mode)

 # 이미지 지우기
 app.send\_keys\_clear()
 # 처리된 이미지를 커스텀 마로 이동