AOSSIE-Org / AOSSIE-Org/PictoPy

BUG: Expensive and repeated Metadata Parsing is bad practice

Open
#1,108 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
283
Forks
679
Avg merge
7d 2h
Merged PRs (30d)
3

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

**Where** : `backend/app/database/images.py`

**What happened ?** : from `app.utils.images` import` image_util_parse_metadata` is called inside the for loop within `db_get_all_images.`

**What should be** : Move from `app.utils.images` import `image_util_parse_metadata `to the top of the file (global scope).

**Why?**: Importing a module inside a tight loop executing thousands of times adds unnecessary overhead (though Python caches it, it's bad practice).

### Record

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.