Announcement

#1 2013-10-05 10:01:43

myroslav
Member
2013-10-05
2

Pre-generate thumbnails on an extrenal PC

I am setting up Piwigo on my home server, driven by Raspberry Pi (low computing resources). It takes ages to generate thumbnails and other sizes of photographs directly on the server. Therefore, I made
a shell script, which generates all required sizes of index images, and copy them to the server, to folder ~/_data/i/galleries/.... .

What works:
- the thumbnails are recognised and displayed properly.
- landscape photos of different sizes are displayed properly

The problem
- portrait photos are displayed as they would be landscape (stretched in horizontal direction)

Technically, all my photographs are stored as landscape with a proper angle tag. When I am
generating thumbnails, and other smaller-size previews, I am rotating them, and erasing "angle" tag
(as piwigo does).

Does piwigo writes something to the DB while generating thumbnails?
How can I tell piwigo that preview images are in the portrait orientation?

Thank you for your response!

Offline

 

#2 2013-10-05 13:55:16

flop25
Piwigo Team
2006-07-06
7037

Re: Pre-generate thumbnails on an extrenal PC

hi
that's because you uploaded the 'raw' pictures not rotated with an angle, so Piwigo remembers that and auto rotate for the generation.
you might use [extension by plg] Photo Update or go to the database, to the table **_images and empty the row rotation with

Code:

UPDATE **_images
SET rotation=0
WHERE rotation=*

To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#3 2013-10-06 08:55:57

myroslav
Member
2013-10-05
2

Re: Pre-generate thumbnails on an extrenal PC

Thanks a lot for suggestion. It is indeed the problem you have pointed out. If I rotate an image before
putting it into the gallery it is shown properly.

I did not manage to update manually the piwigo data-base. After proper log in, using mysql tool, I
tried to execute command:
> UPDATE **_images SET rotation=0 WHERE rotation=*;
However, the outcome is:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '**_images SET rotation=0 WHERE rotation=*' at line 1

Looking through the mysql manual I did not managed to figure out what I am doing wrong.

I would be very grateful for any suggestion.

Offline

 

#4 2013-10-06 13:42:13

flop25
Piwigo Team
2006-07-06
7037

Re: Pre-generate thumbnails on an extrenal PC

you obviously need to replace the * with the correct values


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#5 2014-01-10 02:56:18

jimaek
Member
2013-05-17
41

Re: Pre-generate thumbnails on an extrenal PC

myroslav wrote:

I am setting up Piwigo on my home server, driven by Raspberry Pi (low computing resources). It takes ages to generate thumbnails and other sizes of photographs directly on the server. Therefore, I made
a shell script, which generates all required sizes of index images, and copy them to the server, to folder ~/_data/i/galleries/.... .

What works:
- the thumbnails are recognised and displayed properly.
- landscape photos of different sizes are displayed properly

The problem
- portrait photos are displayed as they would be landscape (stretched in horizontal direction)

Technically, all my photographs are stored as landscape with a proper angle tag. When I am
generating thumbnails, and other smaller-size previews, I am rotating them, and erasing "angle" tag
(as piwigo does).

Does piwigo writes something to the DB while generating thumbnails?
How can I tell piwigo that preview images are in the portrait orientation?

Thank you for your response!

Hey, do you think you could share the script? I am interested in pre-genereting my thumbnails too.

Offline

 

#6 2014-01-16 22:29:41

florian
Member
2014-01-16
2

Re: Pre-generate thumbnails on an extrenal PC

Hello,

I am in a similar situation, trying to host piwigo on a raspberry pi. I have also written a script pre-generating the pictures of various sizes.
I, however, I wasn't as successful as myroslav. Indeed, even though I copied the resulting file in _data/i/....
piwigo keeps re-generating the images while browsing.
I guess the DB should be updated. If it is correct, where can I find documentation on how to do so ?

Thanks!

Offline

 

#7 2014-01-16 22:36:10

flop25
Piwigo Team
2006-07-06
7037

Re: Pre-generate thumbnails on an extrenal PC

as you can see here http://piwigo.org/dev/browser/trunk/i.php that's not the case
http://piwigo.org/dev/browser/trunk/i.php#L338 the script check the Last Modif Time of the original picture and the resized pictures


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#8 2014-01-16 23:11:03

florian
Member
2014-01-16
2

Re: Pre-generate thumbnails on an extrenal PC

Hi,

Thank you. Your answer pointed me to the bug in my script; it does not preserve the extensions while it should. Thanks again.

Offline

 

#9 2014-01-16 23:12:13

flop25
Piwigo Team
2006-07-06
7037

Re: Pre-generate thumbnails on an extrenal PC

:) Have a good day


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact