Problem with photo ( image size )

If you aren't speaking german, you can ask for support or post your request here.
Antworten
Schwartz
Beiträge: 112
Registriert: 26. Dez 2016, 15:19

Problem with photo ( image size )

Beitrag von Schwartz »

Hello ADMIDIO

In web-links there is a problem ( is reported viewtopic.php?f=20&t=7522) when using an image in the text for a link.
To avoid this problem I intended to use the web-links as only links - that means :
A link will be a link to a download and an image will be a link to a photo ( an image in Foto/Photo ).

To have the system perform optimal, I have compressed the images so that a list of weblinks will show quick.
BUT - now comes the problem :

When uploading an image to a photo album, the compressed image is about 4 times as big as the original.
That means that the image shown in weblinks is about 4 times "bigger" as it has to be.
Even when specifying that the original size has to be used it is still the "big" image that is shown - there is (also ) stored an original image ( the compressed size ) then, but this is only to be shown when the photo is "clicked".

The compressed image if it was used as image in text is : 32 Kb
The image that is shown from photo : 135 Kb

Is there a way to have BOTH consistency in the system AND have small ( original compressed ) images to be shown to have fast loading ?

Kind regards
Schwartz

I have an example here : http://www.energifremtiden.dk/c4d/haus.html
It is house-1 I have put in photos.
Benutzeravatar
fasse
Administrator
Beiträge: 6044
Registriert: 12. Nov 2005, 16:06

Re: Problem with photo ( image size )

Beitrag von fasse »

Hi Schwarz,

I don't understand the problem exact. Is there a problem with the photo module and the upload there? Is the thumbnail photo 4 times bigger than the photo you clicked?

Or is the problem that your link to the photo always show the uncompressed photo and you want to view the compressed photo within the link module?

Fasse
Schwartz
Beiträge: 112
Registriert: 26. Dez 2016, 15:19

Re: Problem with photo ( image size )

Beitrag von Schwartz »

Hello Fasse
The problem is :

I have a photo I want(ed) to use as "thumbnail" in weblinks.
The photo/image is 800 x 600.

I have compressed this photo so it is 32 Kb ( Grösse ).
When I upload this to the "Photo" is is saved in a size/Grösse that is 135 Kb.
The system must have processed the image by/at uploading.

It should not be processed as the allowed size for photos is set to 800 x 600.
I then tried to set the system to use "full size" - but the same still happens. BUT then an additional image is stored in "original" ( 32 Kb Grösse ) but it is still the 135 Kb image that is used as thumbnail.

I hope you understand my explanation.

This is not so urgent anymore, as we have set the system in production ( c4dShow.com ) and using the "old" way to create links - by setting up an image in web-links ( here is used the original size - 32 Kb ) . But then we have the question with the "orphan"-images.
The person that sets up his material unfortunately makes some/a lot of errors and often has to do things over again, and this means many left-over images.

I hope a clever guy can find a solution for this.

But I would still like to know if there is a way to avoid the system to "enlarge" the images ( if it will be bigger than the original ) that is being uploaded to the Photos ?

Kind regards
Schwartz
Benutzeravatar
fasse
Administrator
Beiträge: 6044
Registriert: 12. Nov 2005, 16:06

Re: Problem with photo ( image size )

Beitrag von fasse »

Hi Schwartz,

I found the problem and solved it:
https://github.com/Admidio/admidio/issues/663

Now images are not scaled if they are smaller or equal to the size of the preferences.

You can replaced the unzipped file in the following folder adm_program/system/classes

Best regards
Fasse
Dateianhänge
image.php.zip
(2.81 KiB) 213-mal heruntergeladen
Schwartz
Beiträge: 112
Registriert: 26. Dez 2016, 15:19

Re: Problem with photo ( image size )

Beitrag von Schwartz »

Hello Fasse

Thank you.

Kind regards
Schwartz
Schwartz
Beiträge: 112
Registriert: 26. Dez 2016, 15:19

Re: Problem with photo ( image size )

Beitrag von Schwartz »

Hello Fasse

I have tested the attachment.

Whatever I try with settings then the photos ( not all - nearly all ) is resized.

I attach a file with some images.

I have set : max bildgrösse 800 Breite 600 Höhe.
I have tried Skalierung beim Hochladen from 100 to 804 and I have tried with 0 ( nicht erlaubt )

How should the settings be, so the images is not processed. None of the images is wider as 800 or higher as 600.

Could I eventually "disable" resizing in the file ( how to then )

Kind regards
Schwartz
Dateianhänge
1509535017.jpg
1509535017.jpg (31.64 KiB) 7890 mal betrachtet
1509534977.jpg
1509534977.jpg (27.86 KiB) 7890 mal betrachtet
1509533992.jpg
1509533992.jpg (23.79 KiB) 7890 mal betrachtet
Benutzeravatar
fasse
Administrator
Beiträge: 6044
Registriert: 12. Nov 2005, 16:06

Re: Problem with photo ( image size )

Beitrag von fasse »

Ok, I can reproduce the behavior.

The problem is that the picture will be stored on webspace through a php function. So I think this funktion will create a new file with their compression and in your case the file size increased.

But may changes are still there. In version 3.2.11 we rescale the photo even it was less or equal to the uploaded one. With version 3.2.12 we don't call the rescale function and only save the uploaded image.
Schwartz
Beiträge: 112
Registriert: 26. Dez 2016, 15:19

Re: Problem with photo ( image size )

Beitrag von Schwartz »

Hello Fasse

OK - that's why it resizes.

Could/would you attach a 3.2.12 version of the image.php , as this sounds/seems to do what I like the system to do ?
I should be able to use a 3.2.12 version in my 3.2.8 installation - right ?

Just saw that 3.2.12 is released. I will take the image.php from there - is this the only thing/file I have to replace ?

( I don't want to "full" upgrade at this moment )

Kind regards
Schwartz
Benutzeravatar
fasse
Administrator
Beiträge: 6044
Registriert: 12. Nov 2005, 16:06

Re: Problem with photo ( image size )

Beitrag von fasse »

The posted version above is the file of 3.2.12 with the described behavior.
Schwartz
Beiträge: 112
Registriert: 26. Dez 2016, 15:19

Re: Problem with photo ( image size )

Beitrag von Schwartz »

Hello Fasse

Now I'm confused.

The attachment ( image.php.zip ) I installed and then tested - but - the images are still resized even if the proportions says they should not be. Nearly all of the images I uploaded were resized - I attached some examples in my former post.

What is it I don't understand in this ?

Kind regards
Schwartz
Benutzeravatar
fasse
Administrator
Beiträge: 6044
Registriert: 12. Nov 2005, 16:06

Re: Problem with photo ( image size )

Beitrag von fasse »

I have tested it here:
https://www.admidio.org/demo/adm_progra ... p?pho_id=5

The upload scaling is set to 800 and my second image is smaller than 800. So it's not rescaled.
Schwartz
Beiträge: 112
Registriert: 26. Dez 2016, 15:19

Re: Problem with photo ( image size )

Beitrag von Schwartz »

Hello Fasse

I downloaded the image from your link.

The image I downloaded is 92 Kb. ( but still 800 x 532 in proportions as it should be )

The image I attached is 32 ( 31,64 ) Kb. - So - it must have been resized.

BUT - not as much as in "my" system. Here it was resized to 114 Kb.

If the image was not resized it should be 32 Kb - I think.

Or are we talking of different things ?

I am talking of the filesize - you are maybe looking at the scaling. But it is the resizing that I have looked at. The images are up to 4 times the original size ( filesize ). The images is compressed to have quick loading-times.

The system must do some kind of processing of the images - even if it should not - I think.

Kind regards
Schwartz
XimeX
Developer
Beiträge: 1148
Registriert: 12. Jul 2015, 13:21
Wohnort: Austria

Re: Problem with photo ( image size )

Beitrag von XimeX »

Yes i think you talk about different things.
Fasse talks about width and height and you talk about filesize.

Fasse fixed the problem with the resizing of width and height if they are smaller than eg 800x600.

The problem with the filesize is more complicated. I don't think there is a easy fix for this.
But: I have already started some days ago to work on a new fileupload function. But it there is more work to be done. Maybe i get it in v3.3. But more likely in 4.0
Schwartz
Beiträge: 112
Registriert: 26. Dez 2016, 15:19

Re: Problem with photo ( image size )

Beitrag von Schwartz »

Hello XimeX and Fasse

I see. I thought that when no "correction" of the width and/or height were done, that the file then were uploaded without the system doing anything to the file.

Why should the system then perform any action to the file, other than uploading it. You newer know what size the file will have - sometimes it is nearly the same and sometimes it is 4 - 6 times bigger.

In the download module - when you here upload a file that has a filesize of 32 Kb then the uploaded file also have a filesize of 32 Kb.

I continue with images uploaded in links - and hope by time there will come a solution for this ( the orphan images ) also in the future.
Even if it will take some time, I am glad that you ( or another from the team ) will work on a solution.

Kind regards and thanks for helping
Schwartz
Antworten