Jump to content

Topic on Extension talk:SocialProfile

upload avatar does not work

11
Openn1 (talkcontribs)

first thanks for all the hard work what you doing.

We have installed MediaWiki 1.40.1 everything is working exept the upload avatar from SocialProfile

Olso works other uploader for placing images to a blog stories etc olso thumbs works, exept SocialProfile upload does not work

we getting: [21b068a135179427fe87c0fa] 2023-12-06 19:27:04: Fatal exception of type "Error"

Ciencia Al Poder (talkcontribs)
Openn1 (talkcontribs)

Thanks for your respons we have add $wgShowExceptionDetails to true

/index.php?title=Special:UploadAvatar

[0c434d423bdba7ce92964dd4] /index.php?title=Special:UploadAvatar Error: Call to undefined function imagecreatefrompng()

Backtrace:

from E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\extensions\SocialProfile\UserProfile\includes\avatar\UploadAvatarTrait.php(121)

#0 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\extensions\SocialProfile\UserProfile\includes\avatar\UploadAvatarTrait.php(231): UploadAvatar->createThumbnail()

#1 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\includes\specials\SpecialUpload.php(568): UploadAvatar->performUpload()

#2 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\includes\specials\SpecialUpload.php(232): SpecialUpload->processUpload()

#3 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\extensions\SocialProfile\UserProfile\includes\specials\SpecialUploadAvatar.php(69): SpecialUpload->execute()

#4 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\includes\specialpage\SpecialPage.php(701): SpecialUploadAvatar->execute()

#5 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\includes\specialpage\SpecialPageFactory.php(1475): SpecialPage->run()

#6 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\includes\MediaWiki.php(327): MediaWiki\SpecialPage\SpecialPageFactory->executePath()

#7 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\includes\MediaWiki.php(923): MediaWiki->performRequest()

#8 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\includes\MediaWiki.php(576): MediaWiki->main()

#9 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\index.php(50): MediaWiki->run()

#10 E:\HostingSpaces\Futselaa\wiki.openn.eu\wwwroot\index.php(46): wfIndexMain()

#11 {main)

Ciencia Al Poder (talkcontribs)

imagecreatefrompng is a PHP function, available when PHP has been compiled with GD support.

It looks like you'll need to install the php-gd package and/or enable it in php.ini

Openn1 (talkcontribs)
Product Version
MediaWiki 1.40.1
PHP 8.1.13 (cgi-fcgi)
ICU 70.1
MySQL 5.5.28

We have php version 8.1.13

In PHP 8.1, there’s a new lossless WebP encoding support for the GdImage object. It can be enabled using GD extension and libwebp version 0.2.0. The new PHP constant to declare the lossless WebP encoding is

IMG_WEBP_LOSSLESS

IMG_WEBP_LOSSLESS, along with

imagewebp

imagewebp function. In a PHP code, it looks like this:

Plain text

Copy to clipboard

Open code in new window

EnlighterJS 3 Syntax Highlighter

$image = imagecreatefromjpeg('image.jpg');

imagewebp($image, 'image.webp', IMG_WEBP_LOSSLESS);

$image = imagecreatefromjpeg('image.jpg'); imagewebp($image, 'image.webp', IMG_WEBP_LOSSLESS);

$image = imagecreatefromjpeg('image.jpg');
imagewebp($image, 'image.webp', IMG_WEBP_LOSSLESS);

So, how can it work with upload avatar? If we do a normal upload the Thumbs are vissable and uploading works. Only not for the avatar on the SocialProfile. And we use the latest version from your SocialProfile.

Ciencia Al Poder (talkcontribs)

Wiki uploads use imagemagick for thumbnailing. SocialProfile, however, does not and uses PHP GD instead. That may be a reason of why wiki uploads work without errors but avatars don't.

See Manual:Php.ini, create a file in your webserver to display the php information as described on that page, and see if gd is listed as a loaded PHP extension module. Install or enable it and try again until it's listed as enabled.

Openn1 (talkcontribs)

thats not possible , i use a webhosting , other way? Maby a alternative plugin extension for the upload possible to direct upload for the image/avatar map ?

2A02:A212:46:6A80:C7FA:7E42:E348:A5ED (talkcontribs)

So what the sollution ?

Ciencia Al Poder (talkcontribs)

Ask your hosting provider to enable GD. Or get a better hosting provider.

2A02:A212:46:6A80:C7FA:7E42:E348:A5ED (talkcontribs)

becourse everything works ecept your extension for upload you gonna advise change hosting ?

2A02:A212:46:6A80:C7FA:7E42:E348:A5ED (talkcontribs)

problem solved we are back on the version php and now works.

Reply to "upload avatar does not work"