diff --git a/.bzrignore b/.bzrignore index 69e694442..38a8341fa 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 875cb1a4e..175200941 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 5498a6853..a856eb11d 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 97748c55f..5db257018 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 4b44a9dc0..61859f096 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 f01a07ded..c5eb76461 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 b87f8e2c7..47ec213e5 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 418749f76..54d898eb1 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 b5226654b..6abc80725 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 35f86e30d..000000000 --- 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 000000000..4cf93163b 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 000000000..5db88ae40 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 a313ec9d2..000000000 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 6427cf50e..000000000 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 876237492..000000000 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 cff5bd59f..000000000 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 60ba47220..000000000 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 58098d082..000000000 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 21fffbf00..000000000 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 d5571528c..000000000 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 ce3e72020..000000000 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 8659c91db..000000000 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 9e2899690..000000000 Binary files a/static/png/timeline.png and /dev/null differ