OPNsense Forum

English Forums => Tutorials and FAQs => Topic started by: LGDL on August 26, 2025, 09:19:33 PM

Title: What is the recommended format and size for the picture widget ?
Post by: LGDL on August 26, 2025, 09:19:33 PM
I can't seem to find any details about the Picture widget. What format & size work best ?
Title: Re: What is the recommended format and size for the picture widget ?
Post by: vpx on August 27, 2025, 01:46:31 PM
There is no documentation but it's in the source code:

        if ($_FILES['pictfile']['size'] > (10 * 1024 * 1024)) {
            $input_errors[] = gettext("The image file is too large. Please upload something smaller than 10MB.");

So file size is limited to 10 MB. I don't see a pixel limit.

I don't know if transparency is supported but I would suggest .png or .gif format for logos and .jpg for photos.
Title: Re: What is the recommended format and size for the picture widget ?
Post by: drosophila on October 28, 2025, 06:30:53 AM
The image is stored in every config backup file, so you'd not want it to be large filesize-wise. The widget will assume any height, but the width is fixed by the column you put it in, so ideally the image would be an exact match width-wise, but since there is no real way of telling (the widget has a border and a frame, for example). I'd go with something that is slightly larger than what the widget will be, but depending on the source it may look bad scaled. The file size strongly depends on the combination of format and image data, so ideally you'd pick the format that packs the image in the smallest file, like png for line drawings or jpg for pictures with many hues. I'd assume the rendering and scaling is done by the browser in the end, so I'd not use anything unusual, but webp format therefore is OK unless you use old browsers.