"Thumbnails" showing up at full-size on production server

64 visualizações
Pular para a primeira mensagem não lida

Márcio Moreira

não lida,
31 de mar. de 2016, 09:32:0231/03/2016
para Mezzanine Users
Hello friends,

I have a strange problem here. On my local Ubuntu test server the (cartridge) product´s pages shows up correctly, but on my production server (Dreamhost shared hosting) the thumbnails on the product´s pages shows up on full-size, and not "thumbnailed".

Test server:
<ul id="product-images-large" class="list-unstyled list-inline">
   
<li id="image-5-large" >
       
<a class="product-image-large" href="/static/media/uploads/fabrica/tijolo_1.jpg">
           
<img alt="" src="/static/media/uploads/fabrica/.thumbnails/tijolo_1.jpg/tijolo_1-0x300.jpg" class="img-thumbnail img-responsive col-xs-12">
       
</a>
   
</li>

Production server:
<ul id="product-images-large" class="list-unstyled list-inline">
   
<li id="image-5-large" >
       
<a class="product-image-large" href="/static/media/uploads/fabrica/tijolo_1.jpg">
           
<img alt="" src="/static/media/uploads/fabrica/tijolo_1.jpg" class="img-thumbnail img-responsive col-xs-12">
       
</a>
   
</li>

So far I have found that on test server the image source comes from ".thumbnails" folder, but not on the production server.

pip list is almost identical on both servers, only differs on setuptools:
beautifulsoup4 (4.4.1)
bleach
(1.4.2)
Cartridge (0.11.0)
chardet
(2.3.0)
distribute
(0.7.3)
Django (1.9.4)
django
-contrib-comments (1.7.0)
filebrowser
-safe (0.4.3)
future
(0.15.2)
grappelli
-safe (0.4.2)
html5lib
(0.9999999)
Mezzanine (4.1.0)
oauthlib
(1.0.3)
Pillow (3.1.1)
pip
(8.1.1)
pyboleto
(0.2.14)
PyPDF2 (1.25.1)
pytz
(2016.3)
reportlab
(3.3.0)
requests
(2.9.1)
requests
-oauthlib (0.6.1)
setuptools
(12.0.5) (on test server this is 3.3)
six
(1.10.0)
tzlocal
(1.2.2)
xhtml2pdf
(0.0.6)

and this works fine on production server:
$ python3
from PIL import Image

The static folder has been copied from test to production with "rsync -avz source-path/. destiny-path/" with the final dot after origin so dotted folders (.thumbnails)  are transfered. And the source code has been copied using git clone.

Both servers are running virtualenvs with Python 3.4.3. The production server makes use of passenger_wsgi.py to run the application.

Any help will be welcome,

Thanks,
Márcio Moreira






Márcio Moreira

não lida,
11 de abr. de 2016, 09:05:4011/04/2016
para Mezzanine Users
Hello,

After almost 10 days I have found a way to resolve the issue. Please remember the deployment environment is a shared web hosting (dreamhost), and, there, static files must be on separated "public" folder.

I have used rsync to send my files from development server to production server:
So, what worked to fix the issue (with thumbnails not being shown as small images, but at full-size images, messing with product's pages layouts) was simply creating a symbolic link from inside the app's folder to the public/static folder.

cd myapp/
rm -rf static/

But notice that every other pictures always are correctly displayed. Only thumbnails (at product's pages and product's admin pages) are affected by the issue.

Please, Mezzanine Masters, help me understand what happened. What is the probably cause of this issue???

Thanks,
Marcio Moreira

Márcio Moreira

não lida,
11 de abr. de 2016, 10:14:2011/04/2016
para Mezzanine Users

One additional information: the static folder being deleted is one that was automatically created (by django or mezzanine, I believe).

Marcio

Eduardo Rivas

não lida,
11 de abr. de 2016, 11:41:5211/04/2016
para mezzani...@googlegroups.com
Hi Marcio.

There's a lot that can go wrong when generating a thumbnail for a particular image (missing dependencies, filesystem permission errors, IO errors, etc), and Mezzanine will just return the original image if that happens. I recommend you take a look at the code and all the exception handling that happens there and try to determine which one applies to your case.

You should also try to search in the mailing list and the issue tracker, because I remember other people experiencing similar trouble.
Responder a todos
Responder ao autor
Encaminhar
0 nova mensagem