diff --git a/.bzrignore b/.bzrignore index 69e69444..38a8341f 100644 --- a/.bzrignore +++ b/.bzrignore @@ -6,3 +6,4 @@ src bin static/json/pandora.json static/js/pandora.js +static/png/*.png diff --git a/pandora/app/config.py b/pandora/app/config.py index 875cb1a4..17520094 100644 --- a/pandora/app/config.py +++ b/pandora/app/config.py @@ -4,6 +4,7 @@ from __future__ import division, with_statement import os import sys +import shutil import time import thread @@ -72,6 +73,18 @@ def update_static(): with open(pandora_json, 'w') as f: json.dump(sorted(js), f, indent=2) + for size in (16, 64, 256): + pandora = os.path.join(settings.STATIC_ROOT, 'png/pandora/icon%d.png'%size) + image = os.path.join(settings.STATIC_ROOT, 'png/icon%d.png'%size) + if not os.path.exists(image): + shutil.copyfile(pandora, image) + + for size in (256, 1024): + pandora = os.path.join(settings.STATIC_ROOT, 'png/pandora/logo%d.png'%size) + image = os.path.join(settings.STATIC_ROOT, 'png/logo%d.png'%size) + if not os.path.exists(image): + shutil.copyfile(pandora, image) + def init(): load_config() thread.start_new_thread(reloader_thread, ()) diff --git a/pandora/item/views.py b/pandora/item/views.py index 5498a685..a856eb11 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -693,7 +693,7 @@ def poster(request, id, size=None): if item.poster: return image_to_response(item.poster, size) else: - poster_path = os.path.join(settings.STATIC_ROOT, 'png/poster.png') + poster_path = os.path.join(settings.STATIC_ROOT, 'jpg/poster.jpg') response = HttpFileResponse(poster_path, content_type='image/jpeg') response['Cache-Control'] = 'no-cache' return response diff --git a/pandora/itemlist/models.py b/pandora/itemlist/models.py index 97748c55..5db25701 100644 --- a/pandora/itemlist/models.py +++ b/pandora/itemlist/models.py @@ -159,7 +159,7 @@ class List(models.Model): source = self.icon.path max_size = min(self.icon.width, self.icon.height) else: - source = os.path.join(settings.STATIC_ROOT, 'png/list256.png') + source = os.path.join(settings.STATIC_ROOT, 'jpg/list256.jpg') max_size = 256 if size < max_size: extract.resize_image(source, path, size=size) diff --git a/pandora/itemlist/views.py b/pandora/itemlist/views.py index 4b44a9dc..61859f09 100644 --- a/pandora/itemlist/views.py +++ b/pandora/itemlist/views.py @@ -516,5 +516,5 @@ def icon(request, id, size=16): list = qs[0] icon = list.get_icon(int(size)) else: - icon = os.path.join(settings.STATIC_ROOT, 'jpg/list.jpg') + icon = os.path.join(settings.STATIC_ROOT, 'jpg/list256.jpg') return HttpFileResponse(icon, content_type='image/jpeg') diff --git a/static/ttf/DejaVuSansCondensedBold.ttf b/pandora/scripts/data/DejaVuSansCondensedBold.ttf similarity index 100% rename from static/ttf/DejaVuSansCondensedBold.ttf rename to pandora/scripts/data/DejaVuSansCondensedBold.ttf diff --git a/static/png/iconMask.png b/pandora/scripts/data/iconMask.png similarity index 100% rename from static/png/iconMask.png rename to pandora/scripts/data/iconMask.png diff --git a/static/png/iconTimelineInnerMask.png b/pandora/scripts/data/iconTimelineInnerMask.png similarity index 100% rename from static/png/iconTimelineInnerMask.png rename to pandora/scripts/data/iconTimelineInnerMask.png diff --git a/static/png/iconTimelineOuterMask.png b/pandora/scripts/data/iconTimelineOuterMask.png similarity index 100% rename from static/png/iconTimelineOuterMask.png rename to pandora/scripts/data/iconTimelineOuterMask.png diff --git a/static/png/logo.poster.png b/pandora/scripts/data/logo.png similarity index 100% rename from static/png/logo.poster.png rename to pandora/scripts/data/logo.png diff --git a/pandora/scripts/item_icon b/pandora/scripts/item_icon index f01a07de..c5eb7646 100755 --- a/pandora/scripts/item_icon +++ b/pandora/scripts/item_icon @@ -15,7 +15,7 @@ from optparse import OptionParser import sys -static_root = os.path.join(os.path.dirname(__file__), '..', '..', 'static') +static_root = os.path.join(os.path.dirname(__file__), 'data') def render_icon(frame, timeline, icon): icon_width = 1024 diff --git a/pandora/scripts/list_icon b/pandora/scripts/list_icon index b87f8e2c..47ec213e 100755 --- a/pandora/scripts/list_icon +++ b/pandora/scripts/list_icon @@ -16,7 +16,7 @@ from optparse import OptionParser from ox.image import drawText, wrapText import sys -static_root = os.path.join(os.path.dirname(__file__), '..', '..', 'static') +static_root = os.path.join(os.path.dirname(__file__), 'data') def render_list_icon(frames, icon): icon_width = 256 diff --git a/pandora/scripts/oxdb_poster b/pandora/scripts/oxdb_poster index 418749f7..54d898eb 100755 --- a/pandora/scripts/oxdb_poster +++ b/pandora/scripts/oxdb_poster @@ -17,7 +17,7 @@ from ox.image import drawText, wrapText import sys -static_root = os.path.join(os.path.dirname(__file__), '..', '..', 'static') +static_root = os.path.join(os.path.dirname(__file__), 'data') def render_poster(title, director, year, series, oxdb_id, imdb_id, frame, timeline, poster): def get_oxdb_color(oxdb_id, series=False): @@ -107,7 +107,7 @@ def render_poster(title, director, year, series, oxdb_id, imdb_id, frame, timeli # logo logo_height = 32 - logo_image = Image.open(os.path.join(static_root, 'png', 'logo.poster.png')) + logo_image = Image.open(os.path.join(static_root, 'png', 'logo.png')) logo_width = int(round(logo_height * logo_image.size[0] / logo_image.size[1])) logo_image = logo_image.resize((logo_width, logo_height), Image.ANTIALIAS) logo_left = text_width - text_margin - logo_width diff --git a/pandora/scripts/padma_poster b/pandora/scripts/padma_poster index b5226654..6abc8072 100755 --- a/pandora/scripts/padma_poster +++ b/pandora/scripts/padma_poster @@ -16,7 +16,7 @@ from optparse import OptionParser from ox.image import drawText, wrapText import sys -static_root = os.path.join(os.path.dirname(__file__), '..', '..', 'static') +static_root = os.path.join(os.path.dirname(__file__), 'data') def render_poster(id, title, frame, timeline, poster): poster_width = 640 diff --git a/static/html/itemInfo.html b/static/html/itemInfo.html deleted file mode 100644 index 35f86e30..00000000 --- a/static/html/itemInfo.html +++ /dev/null @@ -1,86 +0,0 @@ -
-
-
- -
-
- -
-
-
-
-
- ${title} -
-
- ${director} -
-
- - Country: ${country} - - - Year: ${year} - - - Language: ${language} - - - Runtime: ${runtime} - -
-
- Alternative Title(s): ${alternative_titles} -
-
- Writer: ${writer} -
-
- Producer: ${producer} -
-
- Cast: ${cast} -
-
- Genre: ${genre} -
-
- Keywords: ${keyword} -
-
- Summary: FIXME -
-
- FIXTRIVA -
-
-
- Release Date: ${release_date} -
- - Budget: ${budget} - - - Gross: ${gross} - - - Profit: ${profit} - -
-
- - Rating: ${rating} - - - Votes: ${votes} - -
-
- FIXME: movie connections -
-
- Reviews: ${reviewsHtml} -
-
-
- diff --git a/static/jpg/list256.jpg b/static/jpg/list256.jpg new file mode 100644 index 00000000..4cf93163 Binary files /dev/null and b/static/jpg/list256.jpg differ diff --git a/static/jpg/poster.jpg b/static/jpg/poster.jpg new file mode 100644 index 00000000..5db88ae4 Binary files /dev/null and b/static/jpg/poster.jpg differ diff --git a/static/png/frame.broken.png b/static/png/frame.broken.png deleted file mode 100644 index a313ec9d..00000000 Binary files a/static/png/frame.broken.png and /dev/null differ diff --git a/static/png/frame.png b/static/png/frame.png deleted file mode 100644 index 6427cf50..00000000 Binary files a/static/png/frame.png and /dev/null differ diff --git a/static/png/icon16.png b/static/png/icon16.png deleted file mode 100644 index 87623749..00000000 Binary files a/static/png/icon16.png and /dev/null differ diff --git a/static/png/icon256.png b/static/png/icon256.png deleted file mode 100644 index cff5bd59..00000000 Binary files a/static/png/icon256.png and /dev/null differ diff --git a/static/png/icon64.png b/static/png/icon64.png deleted file mode 100644 index 60ba4722..00000000 Binary files a/static/png/icon64.png and /dev/null differ diff --git a/static/png/iconTimeline.png b/static/png/iconTimeline.png deleted file mode 100644 index 58098d08..00000000 Binary files a/static/png/iconTimeline.png and /dev/null differ diff --git a/static/png/list256.png b/static/png/list256.png deleted file mode 100644 index 21fffbf0..00000000 Binary files a/static/png/list256.png and /dev/null differ diff --git a/static/png/logo1024.png b/static/png/logo1024.png deleted file mode 100644 index d5571528..00000000 Binary files a/static/png/logo1024.png and /dev/null differ diff --git a/static/png/logo256.png b/static/png/logo256.png deleted file mode 100644 index ce3e7202..00000000 Binary files a/static/png/logo256.png and /dev/null differ diff --git a/static/png/pandora256.png b/static/png/pandora/icon256.png similarity index 100% rename from static/png/pandora256.png rename to static/png/pandora/icon256.png diff --git a/static/png/poster.png b/static/png/poster.png deleted file mode 100644 index 8659c91d..00000000 Binary files a/static/png/poster.png and /dev/null differ diff --git a/static/png/timeline.png b/static/png/timeline.png deleted file mode 100644 index 9e289969..00000000 Binary files a/static/png/timeline.png and /dev/null differ