Welcome! Log In Create A New Profile

Advanced

Scaled Images

Posted by nicholas.seward 
Scaled Images
October 14, 2013 05:42PM
The new feature that replaces the images with a scaled down thumbnail is great. I would say that it is an overall improvement. However, the transparency gets replaced with black. Can we preserve the transparency or replace it with a light color?



The dimension I placed on this diagram is now unreadable. I will start putting my own backgrounds but I can't go back and fix my past images.
VDX
Re: Scaled Images
October 14, 2013 06:19PM
... don't find any background or according display settings in the module - maybe one of the server admins can check this?


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Scaled Images
October 14, 2013 06:20PM
Thanks!

I can dig through the source if you want.
Re: Scaled Images
October 14, 2013 08:04PM
The embed image module does not have any parameters for this.

It looks like you have to edit the function...

phorum_api_image_thumbnail()

that is located in

./include/api/image.php

I don't have a Phorum setup to test changes. It should be just a few little changes. I will see were you guys are before I dig into this deeper.
Re: Scaled Images
October 15, 2013 07:12AM
Quote

It looks like you have to edit the function...

phorum_api_image_thumbnail()

that is located in

./include/api/image.php

Wow! Now, this is helpful.

Apparently, the problem is with thumbnail creation. If you view the thumbnail (right click -> view image in Firefox) you actually see an image with black background. So it's not a HTML or CSS issue.

Currently, thumbnails are created with 'convert':
convert - -thumbnail 561x400 -write jpeg:- /dev/null
This /dev/null is to work around a bug in convert, it doesn't affect anything.

Perhaps it's a silly idea to convert PNGs to JPEGs to start with. However, the JPEG format for thumbnails is hardcoded in Phorums' PHP, so it requires more than just removing the 'jpeg:'.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Scaled Images
October 15, 2013 07:44AM
Look above!

The hardcoding is just in this one function, so changing two lines of code was sufficient. PNGs are now kept as PNGs.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Scaled Images
October 15, 2013 08:49AM
Thanks! That was fast.
Re: Scaled Images
October 21, 2013 02:27AM
Cool picture of a cool-looking printer!
Sorry, only registered users may post in this forum.

Click here to login