Skip to content

Commit 33367f1

Browse files
CopilotCodeRafay
andcommitted
Fix matplotlib import order and ensure temp directory exists for hash database
Co-authored-by: CodeRafay <154733908+CodeRafay@users.noreply.github.com>
1 parent 325e06e commit 33367f1

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

analysis/hash_verification.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
from pathlib import Path
2121

2222

23-
# Default database location
24-
DEFAULT_DB_PATH = os.path.join("temp", "hash_database.json")
23+
# Default database location - ensure temp directory exists
24+
_TEMP_DIR = "temp"
25+
os.makedirs(_TEMP_DIR, exist_ok=True)
26+
DEFAULT_DB_PATH = os.path.join(_TEMP_DIR, "hash_database.json")
2527

2628

2729
def generate_perceptual_hash(image_path):

analysis/steganography_detection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
from PIL import Image
1111
import numpy as np
1212
from scipy import stats
13-
import matplotlib.pyplot as plt
1413
import matplotlib
1514
matplotlib.use('Agg') # Use non-interactive backend
15+
import matplotlib.pyplot as plt
1616
import io
1717

1818

0 commit comments

Comments
 (0)