Jump to content
TNG Community

.webp files.. SOLVED


ajnsmits

Recommended Posts

ajnsmits

Good afternoon, everyone,

I have photos and documents with the .webp extension. They’re nice and small in terms of file size. They load really fast and are still easy to read, which is important for birth certificates and such.
But I’ve just noticed that when I hover my mouse over the thumbnail, the photo viewer won’t display them. The Family Preview mod does show the .webp photos of the people, though. Is that other viewer also a mod? According to the wiki, I can add .webp files starting with version 15.
The other file extensions are displayed. If I want to search on Wiki, what is this viewer called?
André

Schermafbeelding 2026-05-30 183154.jpg

Link to comment
Share on other sites

Rob Severijns

André,

I just tested it and I have no problem showing the webp file.
No family preview mod installed


webp.png
 

Rob

Link to comment
Share on other sites

ajnsmits

Okay, thanks for the reply. Now I know it’s possible.
I see you’re running TNG 15.0.4, and I recently installed TNG 15.0.5. Maybe I should check there. 

André

Link to comment
Share on other sites

ajnsmits

Rob, would you be so kind as to check whether the file ajx_smallimage.php contains the same lines as mine?

$photoinfo = @GetImageSize( $imagename );
switch($photoinfo[2]) {
    case 1: //GIF
        $image = @imageCreateFromGif( $imagename );
        break;
    case 3: //PNG
        $image = @imageCreateFromPng( $imagename );
        break;
    default: //JPEG
        $image = @imageCreateFromJpeg( $imagename );
        break;
}
if(is_array($crop)) {
    $image = @imagecrop($image, ['x' => intval($crop[0]), 'y' => intval($crop[1]), 'width' => intval($crop[2]), 'height' => intval($crop[3])]);
    if($image !== FALSE) {
        $photoinfo[0] = $crop[2];
        $photoinfo[1] = $crop[3];
    }
}

 

I've modified this file, and now it works for .webp files. But since it's a system file, I'd still like to know if I've missed an update somewhere.

 

Link to comment
Share on other sites

Rob Severijns

This is what I have.

$photoinfo = @GetImageSize( $imagename );
switch($photoinfo[2]) {
	case 1: //GIF
		$image = @imageCreateFromGif( $imagename );
		break;
	case 3: //PNG
		$image = @imageCreateFromPng( $imagename );
		break;
	default: //JPEG
		$image = @imageCreateFromJpeg( $imagename );
		break;
}
if(is_array($crop)) {
	$image = @imagecrop($image, ['x' => intval($crop[0]), 'y' => intval($crop[1]), 'width' => intval($crop[2]), 'height' => intval($crop[3])]);
    if($image !== FALSE) {
        $photoinfo[0] = $crop[2];
        $photoinfo[1] = $crop[3];
    }
}

It looks the same

Link to comment
Share on other sites

ajnsmits

That's strange, I edited the file, and now the viewer shows the .webp files too. I'm glad I figured it out, and I'll make a private mod out of it so I can update it when the next update comes out.
Thanks, Rob, for your help.

Link to comment
Share on other sites

  • ajnsmits changed the title to .webp files.. SOLVED

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...