Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2021-12-09 00:24:55

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: php 8.1

etc wrote #332137:

Amazing. Are you able to upload avif images?

Yes. The process depends a little depending on the browser. With Firefox the process is the same as for other formats. In Safari (v15), which does not support AVIF, the image uploads but there is absolutely zero feed back (no message pane and anything elese) and at first the image is no listed in the table. Refreshing / reloading the list view solves that. It doesn’t show the image / thumbnail, only the unknown format icon though. But all meta data can be edited as expected.

I have not tried to insert the image in an article. I suppose @<txp:image_info /> correctly returns all image data (width / height).


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#14 2021-12-09 02:08:29

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: php 8.1

phiw13 wrote #332143:

[…] With Firefox the process is the same as for other formats […]

I take that part back. After selecting an AVIF image, I click upload and … nothing happens either. Weird, as when I tried yesterday, I thought it worked normally. IOW, same process as Safari. And Chromium does the same as well.

Another try, with the Firefox console open:

Uncaught SyntaxError: expected expression, got '<'
    jQuery 27
    txpFileupload http://phiw13.local/textpattern/textpattern.js:1908
    jQuery 2

that error does not happen with a .jpg file.

–^–

But, after clicking the “Upload” button, Firefox always shows the “No file selected” string in the file selector as an error message. The selector has an error background in Sandspace and a wine red border in Hive (hard to see…).

That happens independently of PHP versions and Textpattern version (4.8.7+)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#15 2021-12-09 05:41:27

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: php 8.1

Corrections to the two previous posts:

Both AVIF issues are caused by smd_thumbnail (lack of support for AVIF currently) I did not think it would affect the main image upload process. But it does. The JS error above also comes from that plugin.

The Firefox error highlighting of the upload field after uploading images is still there though.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#16 2021-12-09 09:34:08

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: php 8.1

Plugin patched to support AVIF but as I don’t have PHP 8.1 yet it’s untested. Reports welcome.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#17 2021-12-09 10:27:04

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: php 8.1

It looks like PHP getimagesize() function (used for thumbnail creation) is not able to detect the dimensions of AVIF files. Patching as I can, but it looks tough…

Offline

#18 2021-12-09 10:45:43

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: php 8.1

etc wrote #332149:

It looks like PHP getimagesize() function (used for thumbnail creation) is not able to detect the dimensions of AVIF files. Patching as I can, but it looks tough…

Devil’s advocate: do we want to pull this from 4.8.8 and defer to 4.8.9?

Offline

#19 2021-12-09 11:26:31

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: php 8.1

Issue with thumbnail creation – both using the TXP-core function and the smd_thumbnail plugin

First without the plugin:

Warning "imagecreatefromavif(): AVIF image support has been disabled
"
in /Users/username/Sites/phiw13-local/textpattern/lib/class.thumb.php at line 308.

adminErrorHandler()
textpattern/lib/class.thumb.php:308 imagecreatefromavif()
textpattern/lib/class.thumb.php:546 wet_thumb->write()
textpattern/include/txp_image.php:1123 txp_thumb->write()
textpattern/include/txp_image.php:64 thumbnail_create()
textpattern/index.php:230 include()

and

Warning "imagecreatefromavif(): "/Users/username/Sites/phiw13-local/images/45.avif" is not a valid AVIF file"
in /Users/username/Sites/phiw13-local/textpattern/lib/class.thumb.php at line 308.

adminErrorHandler()
textpattern/lib/class.thumb.php:308 imagecreatefromavif()
textpattern/lib/class.thumb.php:546 wet_thumb->write()
textpattern/include/txp_image.php:1123 txp_thumb->write()
textpattern/include/txp_image.php:64 thumbnail_create()
textpattern/index.php:230 include()

and then (formatted like this):

Fatal error: Uncaught DivisionByZeroError: Division by zero in /Users/username/Sites/phiw13-local/textpattern/lib/class.thumb.php:334 Stack trace: #0 /Users/username/Sites/phiw13-local/textpattern/lib/class.thumb.php(546): wet_thumb->write('/Users/username/S...', '/Users/username/S...') #1 /Users/username/Sites/phiw13-local/textpattern/include/txp_image.php(1123): txp_thumb->write() #2 /Users/username/Sites/phiw13-local/textpattern/include/txp_image.php(64): thumbnail_create() #3 /Users/username/Sites/phiw13-local/textpattern/index.php(230): include('/Users/username/S...') #4 {main} thrown in /Users/username/Sites/phiw13-local/textpattern/lib/class.thumb.php on line 334

and finally smd_thumbnail latest patch, shorter:

Fatal error: Uncaught DivisionByZeroError: Division by zero in /Users/username/Sites/phiw13-local/textpattern/lib/class.thumb.php:240 Stack trace: #0 /Users/username/Sites/phiw13-local/plugin_core/smd_thumbnail/smd_thumbnail.php(420): wet_thumb->write('/Users/username/S...', '/Users/username/S...') #1 /Users/username/Sites/phiw13-local/plugin_core/smd_thumbnail/smd_thumbnail.php(478): smd_thumb->write_image() #2 /Users/username/Sites/phiw13-local/plugin_core/smd_thumbnail/smd_thumbnail.php(678): smd_thumb_make(Array, Array, 1) #3 /Users/username/Sites/phiw13-local/textpattern/lib/txplib_misc.php(1589): smd_thumb_edit('image_ui', 'thumbnail_edit', '\n<form class="u...', Array) #4 /Users/username/Sites/phiw13-local/textpattern/lib/txplib_admin.php(791): callback_event('image_ui', 'thumbnail_edit', 0, '\n<form class="u...', Array) #5 /Users/username/Sites/phiw13-local/textpattern/include/txp_image.php(665): pluggable_ui('image_ui', 'thumbnail_edit', '\n<form class="u...', Array) #6 /Users/username/Sites/phiw13-local/textpattern/include/txp_image.php(64): image_edit() #7 /Users/username/Sites/phiw13-local/textpattern/index.php(230): include('/Users/username/S...') #8 {main} thrown in /Users/username/Sites/phiw13-local/textpattern/lib/class.thumb.php on line 240

Hope that helps some, but, dunno, given your (Oleg) comments above. Depending on how energy you have, fixing is possibly problematic. As Pete suggest, postponing to a later release is an option.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#20 2021-12-09 11:42:58

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: php 8.1

I still hope to make AVIF work in 4.8.8, at least partially.

Offline

#21 2021-12-09 21:40:45

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: php 8.1

Please retest image operations in 4.8.8, be it PHP 8.1 or not. Thanks.

Offline

#22 2021-12-10 00:46:08

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: php 8.1

Uploading JPG/PNG/WEBP: OK. Thumbnail generation for those images: OK.

Uploading AVIF images: nothing anymore. Image is not uploaded, there is no TXP message and no debug messages/warnings/errors

Firefox and Safari, with and without smd_thumbnails (I went as far as completely uninstalling the plugin…).


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#23 2021-12-10 08:14:24

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: php 8.1

BTW – installing 4.8.8latest with PHP 8.1.0 + MySQL 8.0.* goes well (success)/

BTW – quoting me above:

Click on the logout button (TR) triggers, after the “Are you sure?” browser dialog, a second browser dialog: “internal error”.

This error has now disappeared. TY.
Verified with 2 different installs, one an “old” one, and a freshly made new vanilla one.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#24 2021-12-10 09:17:24

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: php 8.1

Accessing the Themes panel (vanilla install):

8192 "Return type of Textpattern\Iterator\RecFilterIterator::getChildren() should either be compatible with RecursiveFilterIterator::getChildren(): ?RecursiveFilterIterator, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice"
in /Users/username/Sites/_txp-dev/textpattern/vendors/Textpattern/Iterator/RecFilterIterator.php at line 68.

textpattern/vendors/Textpattern/Loader.php:152 adminErrorHandler()
textpattern/vendors/Textpattern/Loader.php:152 require_once()
Textpattern\Loader->load()
textpattern/vendors/Textpattern/Container/Container.php:116 method_exists()
textpattern/vendors/Txp.php:54 Textpattern\Container\Container->getInstance()
textpattern/vendors/Textpattern/Skin/CommonBase.php:495 Txp::get()
textpattern/vendors/Textpattern/Skin/Skin.php:385 Textpattern\Skin\CommonBase->getFiles()
textpattern/vendors/Textpattern/Skin/Skin.php:410 Textpattern\Skin\Skin->setUploaded()
textpattern/vendors/Textpattern/Skin/Skin.php:1207 Textpattern\Skin\Skin->getUploaded()
textpattern/vendors/Textpattern/Skin/Skin.php:1188 Textpattern\Skin\Skin->getImportForm()

8192 "Return type of Textpattern\Iterator\RecFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice"
in /Users/username/Sites/_txp-dev/textpattern/vendors/Textpattern/Iterator/RecFilterIterator.php at line 77.

textpattern/vendors/Textpattern/Loader.php:152 adminErrorHandler()
textpattern/vendors/Textpattern/Loader.php:152 require_once()
Textpattern\Loader->load()
textpattern/vendors/Textpattern/Container/Container.php:116 method_exists()
textpattern/vendors/Txp.php:54 Textpattern\Container\Container->getInstance()
textpattern/vendors/Textpattern/Skin/CommonBase.php:495 Txp::get()
textpattern/vendors/Textpattern/Skin/Skin.php:385 Textpattern\Skin\CommonBase->getFiles()
textpattern/vendors/Textpattern/Skin/Skin.php:410 Textpattern\Skin\Skin->setUploaded()
textpattern/vendors/Textpattern/Skin/Skin.php:1207 Textpattern\Skin\Skin->getUploaded()
textpattern/vendors/Textpattern/Skin/Skin.php:1188 Textpattern\Skin\Skin->getImportForm()

Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

Board footer

Powered by FluxBB