<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Hi William,</div><div><br></div><div>First of all thanks for your fast and detailed reply.</div><div><br></div><div>I save the rendering settings as default each time, in the application they are meant to be always the same.</div><div>I want a behaviour without defaults, because the default values are provided by another service.</div><div><br></div><div>It wasn’t necessary to set the variable “img" twice, this is the new source code, following your advice:</div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(144, 144, 144);">@login_required<span style="color: #000000">()</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"><span style="color: #0433ff">def</span> render_slice_thumbnail (request, iid, z, t, w=<span style="color: #0433ff">None</span>, h=<span style="color: #0433ff">None</span>, conn=<span style="color: #0433ff">None</span>, _defcb=<span style="color: #0433ff">None</span>, **kwargs):</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #00b400">"""</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(0, 180, 0);"> Returns an HttpResponse wrapped jpeg with the rendered thumbnail for image ‘iid’ for the z, t slice</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(0, 180, 0);"> @param request: http request</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(0, 180, 0);"> @param iid: Image ID</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(0, 180, 0);"> @param z: Z index</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(0, 180, 0);"> @param t: T index</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(0, 180, 0);"> @param w: Thumbnail max width. 64 by default</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(0, 180, 0);"> @param h: Thumbnail max height</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(0, 180, 0);"> @return: http response containing jpeg</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(0, 180, 0);"> """</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> server_id = request.session[<span style="color: #00b400">'connector'</span>].server_id</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> direct = <span style="color: #0433ff">True</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">if</span> w <span style="color: #0433ff">is</span> <span style="color: #0433ff">None</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> size = (<span style="color: #941100">64</span>,)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">else</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">if</span> h <span style="color: #0433ff">is</span> <span style="color: #0433ff">None</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> size = (int(w),)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">else</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> size = (int(w), int(h))</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">if</span> size == (<span style="color: #941100">96</span>,):</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> direct = <span style="color: #0433ff">False</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(203, 203, 203);"><span style="color: #000000"> </span>#OMERO only generates thumbnails for saved rendering settings </div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> pi = _get_prepared_image(request, iid, server_id=server_id, saveDefs=<span style="color: #0433ff">True</span>, conn=conn) </div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">if</span> pi <span style="color: #0433ff">is</span> <span style="color: #0433ff">None</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> logger.debug(<span style="color: #00b400">"(b)Image %s not found..."</span> % (str(iid)))</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">if</span> _defcb:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> jpeg_data = _defcb(size=size)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> prevent_cache = <span style="color: #0433ff">True</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">else</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">raise</span> Http404</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> img, compress_quality = pi</div><p style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px;"> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> rdefId = request.REQUEST.get(<span style="color: #00b400">'rdefId'</span>, <span style="color: #0433ff">None</span>)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">if</span> rdefId <span style="color: #0433ff">is</span> <span style="color: #0433ff">not</span> <span style="color: #0433ff">None</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> rdefId = int(rdefId)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(203, 203, 203);"><span style="color: #000000"> </span>#Thumbnail code</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> jpeg_data = webgateway_cache.getImage(request, server_id, img, z, t, ctx=<span style="color: #00b400">'thumbslice'</span> + w + <span style="color: #00b400">'x'</span> + h)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">if</span> jpeg_data <span style="color: #0433ff">is</span> <span style="color: #0433ff">None</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> prevent_cache = <span style="color: #0433ff">False</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> jpeg_data = img.getThumbnail(size=size, z=int(z), t=int(t), direct=direct, rdefId=rdefId)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">if</span> jpeg_data <span style="color: #0433ff">is</span> <span style="color: #0433ff">None</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> logger.debug(<span style="color: #00b400">"(c)Image %s not found..."</span> % (str(iid)))</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">if</span> _defcb:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> jpeg_data = _defcb(size=size)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> prevent_cache = <span style="color: #0433ff">True</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">else</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">return</span> HttpResponseServerError(<span style="color: #00b400">'Failed to render thumbnail'</span>)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">else</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> prevent_cache = img._thumbInProgress</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">if</span> <span style="color: #0433ff">not</span> prevent_cache:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> webgateway_cache.setImage(request, server_id, img, z, t, jpeg_data, ctx=<span style="color: #00b400">'thumbslice'</span> + w + <span style="color: #00b400">'x'</span> + h)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">else</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">pass</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> rsp = HttpResponse(jpeg_data, content_type=<span style="color: #00b400">'image/jpeg'</span>)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">return</span> rsp</div></div><div><br></div><div>If this behaviour that sets defaults on each call is ok I would like to rebase my code and prepare a pull request.</div><div>Calling the same function without the render attributes uses the last saved ones and the attributes are used to generate the cache element.</div><div><br></div><div>Regarding other questions:</div><div><br></div><div>1,3,4) Thanks for your advice on the web server.</div><div>2) We are currently on 5.1 develop as we need the functionality for float images (I am pulling from git).</div><div>I was reading online documentation for an older version (documentation for 5.1 is not online).</div><div>However, the _prepareTB() function has a defaul parameter “_r” which do not seem to be used, but was used to reset something to default.</div><div><br></div><div>Another question: Where is the code for the server side of these RPC calls (renderJpeg, getThumbnail…)? We may need in the future to implement other functions.</div><div><br></div><div>Best wishes,</div><div>José Salavert</div><br><div><div>On 12 Dec 2014, at 13:47, William Moore <<a href="mailto:will@lifesci.dundee.ac.uk">will@lifesci.dundee.ac.uk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Jose,<div><br></div><div> OMERO is only designed to generate thumbnails for saved rendering settings, so what you want to do (get a thumbnail with new rendering settings)</div><div>is not directly supported.</div><div><br></div><div>You have basically 2 choices:</div><div> - Save the rendering settings, then create a thumbnail.</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>If you add saveDefs=True to this line:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>pi = _get_prepared_image(request, iid, server_id=server_id, saveDefs=True, conn=conn)</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>then you will see the effect of the rendering settings ?c=1|-3000:3000</div><div><br></div><div> - Don't use the thumbnail service, just render a full-size plane with renderJpeg() and scale it yourself (e.g. using PIL).</div><div><br></div><div><br></div><div>In your code sample, you've combined these 2 approaches.</div><div>e.g. you are setting the 'img' variable twice (notice the different handling of None in each case)</div><div><br></div><div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="margin: 0px; font-size: 11px; font-family: Monaco; "> pi = _get_prepared_image(request, iid, server_id=server_id, conn=conn)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "> <span style="color: rgb(4, 51, 255); ">if</span> pi <span style="color: rgb(4, 51, 255); ">is</span> <span style="color: rgb(4, 51, 255); ">None</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "> <span style="color: rgb(4, 51, 255); ">raise</span> Http404</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "> img, compress_quality = pi</div></div></blockquote><br></div><div><br></div><div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="margin: 0px; font-size: 11px; font-family: Monaco; "> img = conn.getObject(<span style="color: rgb(0, 180, 0); ">"Image"</span>, iid)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "> <span style="color: rgb(4, 51, 255); ">if</span> img <span style="color: rgb(4, 51, 255); ">is</span> <span style="color: rgb(4, 51, 255); ">None</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "> logger.debug(<span style="color: rgb(0, 180, 0); ">"(b)Image %s not found..."</span> % (str(iid)))</div></div></blockquote></div><div><br></div><div><br></div><div><br></div><div>1) For development, I tend to run the Django development server directly, although we are moving</div><div>away from this practise and others do it differently.</div><div><br></div><div>Here's what I do:</div><div><br></div><div># for logging to dist/var/log (don't set this in production server)</div><div>export OMERO_HOME=/path/to/OMERO/dist</div><div><br></div><div># make sure server libs are on python path...</div><div>export PYTHONPATH=$OMERO_HOME/lib/python:$PYTHONPATH</div><div><br></div><div># … but remove omeroweb libs (so they don't get imported in python)</div><div>$ rm -rf dist/lib/python/omeroweb/</div><div><br></div><div># run omeroweb directly</div><div>$ cd components/tools/OmeroWeb</div><div>$ python omeroweb/manage.py runserver 0.0.0.0:4080</div><div><br></div><div><br></div><div>2) Are you using OMERO 5.0 or OMERO 5.1 (develop)?</div><div>In Blitz Gateway</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>img.getThumbnail(size=size, z=int(z), t=int(t), direct=direct, rdefId=rdefId)</div><div>the rdefId parameter was added in 5.1 and is used in </div><div>the following line:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>tb = self._prepareTB(rdefId=rdefId)</div><div><br></div><div><br></div><div>3) Web logs are in dist/var/log/OMEROweb.log</div><div>However, since they can be kinda verbose, I tend to simply add print statements</div><div>and view these in the console where the development server is running.</div><div><br></div><div><br></div><div>4) If you monitor the server logs while refreshing your thumbnail in the browser…</div><div><br></div><div>$ tail -f dist/var/log/Blitz-0.log</div><div><br></div><div>you can see lines like this:</div><div><br></div><div><div>2014-12-12 13:40:31,754 INFO [ ome.services.util.ServiceHandler] (.Server-55) Meth:<span class="Apple-tab-span" style="white-space:pre"> </span>interface ome.api.ThumbnailStore.getThumbnailForSectionByLongestSideDirect</div><div>2014-12-12 13:40:31,754 INFO [ ome.services.util.ServiceHandler] (.Server-55) Args:<span class="Apple-tab-span" style="white-space:pre"> </span>[30, 0, 64]</div><div>2014-12-12 13:40:31,755 INFO [ ome.security.basic.BasicEventContext] (.Server-55) cctx:<span class="Apple-tab-span" style="white-space:pre"> </span>group=5</div></div><div><br></div><div><br></div><div> Hope that helps,</div><div><br></div><div> Will.</div><div><br></div><div><br></div><div><br></div><div><div><div>On 12 Dec 2014, at 12:02, José Salavert Torres <<a href="mailto:josator@ebi.ac.uk">josator@ebi.ac.uk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Dear Omero Developers,<div><br></div><div>I am trying to use OMERO Web to visualise image thumbnails of any slice (z,t) and supporting rendering parameters as well, concretely those related with the contrast (?c=1|-3000,3000).</div><div>So far I managed to add a new django web service to OMERO Web.</div><div>This new view is able to render these down-sampled versions of the images at any Z and T (this option was already implemented in OMERO Py omero.gateway package in the <span style="font-family: Monaco; font-size: 11px;">getThumbnail() function</span>, but not accessible from OMERO Web).</div><div>The new view is also capable of using the webgateway_cache to store the files using setImage() and getImage() with a special ctx string that is added to the image id.</div><div><br></div><div>However, for the EMPIAR 3D viewer I need also to set the contrast of the down-sampled images, so I would need support for (?c=1|-3000,3000) parameters to adjust the contrast of the thumbnail.</div><div><br></div><div>If you could provide some feedback on OMERO PY omero.gateway package I would appreciate it. I am digging in the getThumbnail(), _prepareTB() and renderJpeg(). I think that _prepareTB is resetting the context parameters but I am not sure about this.</div><div><br></div><div>So far this is the code for the new OMERO Web Call:</div><div><br></div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(144, 144, 144);">@login_required<span style="">()</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"><span style="color: #0433ff">def</span> render_slice_thumbnail (request, iid, z, t, w=<span style="color: #0433ff">None</span>, h=<span style="color: #0433ff">None</span>, conn=<span style="color: #0433ff">None</span>, _defcb=<span style="color: #0433ff">None</span>, **kwargs):</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #00b400">"""</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(0, 180, 0);"> Returns an HttpResponse wrapped jpeg with the rendered thumbnail for image 'iid'</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(0, 180, 0);"> @param request: http request</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(0, 180, 0);"> @param iid: Image ID</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(0, 180, 0);"> @param z: Z index</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(0, 180, 0);"> @param t: T index</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(0, 180, 0);"> @param w: Thumbnail max width. 64 by default</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(0, 180, 0);"> @param h: Thumbnail max height</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(0, 180, 0);"> @return: http response containing jpeg</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(0, 180, 0);"> """</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> server_id = request.session[<span style="color: #00b400">'connector'</span>].server_id</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> direct = <span style="color: #0433ff">True</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">if</span> w <span style="color: #0433ff">is</span> <span style="color: #0433ff">None</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> size = (<span style="color: #941100">64</span>,)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">else</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">if</span> h <span style="color: #0433ff">is</span> <span style="color: #0433ff">None</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> size = (int(w),)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">else</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> size = (int(w), int(h))</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">if</span> size == (<span style="color: #941100">96</span>,):</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> direct = <span style="color: #0433ff">False</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px; "> <br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> pi = _get_prepared_image(request, iid, server_id=server_id, conn=conn)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">if</span> pi <span style="color: #0433ff">is</span> <span style="color: #0433ff">None</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">raise</span> Http404</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> img, compress_quality = pi</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px; "> <br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> rdefId = request.REQUEST.get(<span style="color: #00b400">'rdefId'</span>, <span style="color: #0433ff">None</span>)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">if</span> rdefId <span style="color: #0433ff">is</span> <span style="color: #0433ff">not</span> <span style="color: #0433ff">None</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> rdefId = int(rdefId)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> jpeg_data = webgateway_cache.getImage(request, server_id, img, z, t, ctx=<span style="color: #00b400">'thumbslice'</span> + w + <span style="color: #00b400">'x'</span> + h)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">if</span> jpeg_data <span style="color: #0433ff">is</span> <span style="color: #0433ff">None</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> prevent_cache = <span style="color: #0433ff">False</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> img = conn.getObject(<span style="color: #00b400">"Image"</span>, iid)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">if</span> img <span style="color: #0433ff">is</span> <span style="color: #0433ff">None</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> logger.debug(<span style="color: #00b400">"(b)Image %s not found..."</span> % (str(iid)))</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">if</span> _defcb:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> jpeg_data = _defcb(size=size)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> prevent_cache = <span style="color: #0433ff">True</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">else</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">raise</span> Http404</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">else</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> jpeg_data = img.getThumbnail(size=size, z=int(z), t=int(t), direct=direct, rdefId=rdefId)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">if</span> jpeg_data <span style="color: #0433ff">is</span> <span style="color: #0433ff">None</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> logger.debug(<span style="color: #00b400">"(c)Image %s not found..."</span> % (str(iid)))</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">if</span> _defcb:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> jpeg_data = _defcb(size=size)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> prevent_cache = <span style="color: #0433ff">True</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">else</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">return</span> HttpResponseServerError(<span style="color: #00b400">'Failed to render thumbnail'</span>)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">else</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> prevent_cache = img._thumbInProgress</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">if</span> <span style="color: #0433ff">not</span> prevent_cache:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> webgateway_cache.setImage(request, server_id, img, z, t, jpeg_data, ctx=<span style="color: #00b400">'thumbslice'</span> + w + <span style="color: #00b400">'x'</span> + h)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">else</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">pass</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> rsp = HttpResponse(jpeg_data, content_type=<span style="color: #00b400">'image/jpeg'</span>)</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"> <span style="color: #0433ff">return</span> rsp</div></div><div><br></div><div><br></div><div>The parameters in the context (?c=1|-3000,3000) are set using the _get_prepared_image function() (which is a function used in render_image call).</div><div>However the image is not modified.</div><div><br></div><div>Some questions:</div><div><br></div><div>1 - How can I compile the OmeroWeb package and run it. I have tryed compiling components/tools/omeroWEB only, but then the command omero web start does not load the updated version. Also the default option for “components/tools/OmeroWeb/build.xml </div><div><br></div><div>2 - In img.getThumbnail(size=size, z=int(z), t=int(t), direct=direct, rdefId=rdefId) rdefId is not used inside the function, the same for the _r in _prepareTB().</div><div><br></div><div>3- Where are the logs of the "omero web start” command stored? I would like to check if _prepareTB() is reseting the grayscale parameters in the context. Also, how can I manually kill the web server if it hangs?</div><div><br></div><div>4- I am lost when the code reaches OmeroPy/build/lib/omero_api_ThumbnailSotre_ice.py remote procedure calls (def getThumbnailForSectionDirect(self, theZ, theT, sizeX, sizeY, _ctx=None)). I would like to check also if the context parameters are read by the generate thumbnail function in the server side.</div><div><br></div><div>Thank you in advance,</div><div>José Salavert Torres</div><div>EMBL-EBI, pdbe/emdb/empiar3d</div><div><br></div></div>_______________________________________________<br>ome-devel mailing list<br><a href="mailto:ome-devel@lists.openmicroscopy.org.uk">ome-devel@lists.openmicroscopy.org.uk</a><br><a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel</a><br></blockquote></div><br></div></div></blockquote></div><br></body></html>