Beispiel #1
0
def createTiles(user,imname):
  topic = "/image/"+user+"/"+imname
  im = models.loadImageD(topic)
  tl  = models.Tiling(im,256,1);
  tl.createTiles([])
  numtiles = len(tl.tiles)
  tl.createImageFiles()
  return numtiles
Beispiel #2
0
def rih(im):
  tp = "/image/cg/"+im
  models.reduceImageHeight(tp,100)
  s3.s3SaveFile("/resizedh100/cg/"+im+".jpg")
  print "TOPIC ",tp
  im = models.loadImageD(tp)
  im.atS3 = 1
  im.beenTiled = 1
  im.dynsave()
Beispiel #3
0
theStore = store.theStore
import store.dynamo
dyn = store.dynamo
import model.models
models = model.models
import store.snaps
snaps = store.snaps
import store.jobs
jobs = store.jobs
import ops.logs
logs = ops.logs
import store.log
logstore = store.log


im = models.loadImageD("/image/cg/test12")


import ops.s3
s3 = ops.s3
"""
ss = logstore.initStore()

logstore.newLogEntry(23,"cg",4,1243)
vv = logstore.selectLogEntries(23,"cg",4)
"""

"""
from api.job import buildTiling,s3Init,s3SaveFile

#rr = logs.logKeys()
Beispiel #4
0
export PYTHONPATH
cd /mnt/ebs0/imagediverdev/py
python image_scripts/set_image_user.py cg astoria_1923_1
python image_scripts/print_image.py cg mulberry_1


"""

import constants
import re
constants.dbDir = "/mnt/ebs0/imagediverdev/dbs/"
constants.logDir = "/mnt/ebs0/imagediverdev/log/"
import Logr
import sys
args = sys.argv
user = args[1]
image = args[2]

topic = "/image/" + user + "/" + image

import model.models
models = model.models

Logr.log("dstore", "HERE")

im = models.loadImageD(topic)
print im
print str(im.__dict__)

quit()
Beispiel #5
0
def createResized(user,imname):
  topic = "/image/"+user+"/"+imname
  im = models.loadImageD(topic)
  models.reduceImageRes(topic)
Beispiel #6
0
def printIm(user,imname):
  topic = "/image/"+user+"/"+imname
  im = models.loadImageD(topic)
  print str(im.__dict__)
 
  
Beispiel #7
0
imname = args[2]
album = args[3]

import constants
import model.models

models = model.models
import json
import Logr
import store.theStore

theStore = store.theStore

imageTopic = "/image/" + imowner + "/" + imname
albumTopic = "/album/" + imowner + "/" + imname + "/" + album
im = models.loadImageD(imageTopic)
snaps = models.snapsInAlbum(albumTopic)
#theStore.topicsWithPropertyValue('/type/snapD','album',albumTopic)
snapDs = theStore.descriptor(snaps, '/type/snapD')
imx = im.dimensions["x"]


def scaleCoverage(cv, sc, digits):
    rs = {}
    crn = cv["corner"]
    rs['corner'] = {"x": sc * crn["x"], "y": sc * crn["y"]}
    ext = cv["extent"]
    rs["extent"] = {"x": sc * ext["x"], "y": sc * ext["y"]}
    return rs