No Code Attached Yet J4 Media Manager
avatar gwstyles
gwstyles
26 Aug 2021

Try editing images in J 4 template editor.

While testing the template editor in j4.0.2 I can not see the svg images.The screen shot shows that J4 thinks I do not have the GD library available ,but it is? Is this a bug or does it work for you?
Also the documentation button goes to J3 info not J4.

Expected result It works

Actual result see imagesscreen shot 2021-08-26 at 16 43 38

System information (as much as possible)

Site Information

Setting 	Value

PHP Built On Linux manganese.cloudhosting.co.uk 4.18.0-305.10.2.2.lve.el7h.x86_64 #1 SMP Wed Jul 28 13:09:44 UTC 2021 x86_64
Database Type mysql
Database Version 10.3.30-MariaDB-log-cll-lve
Database Collation latin1_swedish_ci
Database Connection Collation utf8mb4_general_ci
Database Connection Encryption None
Database Server Supports Connection Encryption No
PHP Version 8.0.9
Web Server LiteSpeed
WebServer to PHP Interface litespeed
Joomla! Version Joomla! 4.0.2 Stable [ Furaha ] 24-August-2021 19:54 GMT
User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0
Articles

Additional comments

screen shot 2021-08-26 at 16 43 40

avatar gwstyles gwstyles - open - 26 Aug 2021
avatar gwstyles gwstyles - change - 26 Aug 2021
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 26 Aug 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 26 Aug 2021
avatar brianteeman
brianteeman - comment - 26 Aug 2021

Could you upload larger images please.

avatar wojsmol
wojsmol - comment - 26 Aug 2021

@brianteeman On screan shot posted by @gwstyles there's visible COM_TEMPLATES_GD_EXTENSION_NOT_AVAILABLE message.

avatar PhilETaylor
PhilETaylor - comment - 26 Aug 2021

More of my shit code. a1ab74a

System Information reads from extension_loaded('gd') this is correct.

Template manager is not checking for GD, its using COM_TEMPLATES_GD_EXTENSION_NOT_AVAILABLE as a placeholder when handling ANY RuntimeException ... could literally be any exception and it will just say that GD is not available.

Extract the following Zip file, and then Upload the file it contains to /administrator/components/com_templates/src/View/Template/HtmlView.php and try again and report back what the message is that is shown this time please.

HtmlView.php.zip

avatar gwstyles
gwstyles - comment - 26 Aug 2021

Do you need larger images or is it ok?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35386.

avatar PhilETaylor
PhilETaylor - comment - 26 Aug 2021

I dont need larger images. Just follow the instructions I have provided and provide the messages that this dumps to the screen when you try.

avatar gwstyles
gwstyles - comment - 26 Aug 2021

I cant paste it here?
see attached.error message.txt


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35386.

avatar PhilETaylor
PhilETaylor - comment - 26 Aug 2021

well that comes from getimagesize() PHP function which Joomla throws a UnparsableImageException Exception for which implements RuntimeException

Which image are you trying to edit? Can you upload that EXACT image here please.

avatar gwstyles
gwstyles - comment - 26 Aug 2021

Cant upload a svg, change jpg to .svg


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35386.

avatar PhilETaylor
PhilETaylor - comment - 26 Aug 2021

You cannot edit SVG Files with Joomla's template manager The only formats supported are

	static::$formats[IMAGETYPE_JPEG] = $info['JPEG Support'];
			static::$formats[IMAGETYPE_PNG]  = $info['PNG Support'];
			static::$formats[IMAGETYPE_GIF]  = $info['GIF Read Support'];
			static::$formats[IMAGETYPE_WEBP] = $info['WebP Support'];
avatar gwstyles
gwstyles - comment - 26 Aug 2021

JPG extension tells me invalid mime type, so I have changed it to txt.
First time on git and a bit odd for an old git...screen shot 2021-08-26 at 18 14 42


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35386.

avatar PhilETaylor
PhilETaylor - comment - 26 Aug 2021

SVG is not "really" an image. It is an XML file - this is why GD gets confused. I'll write some code to catch this over the weekend.

avatar gwstyles
gwstyles - comment - 26 Aug 2021

OK that dont work,how do you upload an svg image to git?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35386.

avatar PhilETaylor
PhilETaylor - comment - 26 Aug 2021

You dont need to upload the SVG, I have already told you the problem and the solution.

Problem: SVG is not an image type. You are trying to edit a SVG. Joomla is not stopping you (it should) and passes the SVG to GD which complains when running getimagesize() function

Solution: You cannot edit SVG in Joomla Template Manager. We also need to improve Joomla 4 to not allow you to attempt to, and to show you error messages like "You cannot edit SVG files in Joomla admin".

avatar gwstyles
gwstyles - comment - 26 Aug 2021

OK its not a bug then just not designed to do this.Good stuff lads.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35386.

avatar dgrammatiko
dgrammatiko - comment - 26 Aug 2021

You cannot edit SVG Files with Joomla's template manager The only formats supported are

@PhilETaylor in the template editor you should be able to edit the svg (using the codemirror editor, basically editing the text)

avatar PhilETaylor
PhilETaylor - comment - 26 Aug 2021

Yes but when Im talking about editing images with GD, they have to be one of those formats - not XML based SVG, which should be edited, not with GD Functions, but with text editor functions.

avatar dgrammatiko
dgrammatiko - comment - 26 Aug 2021

Yes but when Im talking about editing images with GD, they have to be one of those formats

Even Media manager can't handle all of the possible image formats (gif, ...) for some good reasons:

return ['jpg', 'jpeg', 'png'].indexOf(this.item.extension.toLowerCase()) > -1;

avatar PhilETaylor
PhilETaylor - comment - 26 Aug 2021

LMAO - a Media manager that can only handle 3 file types LMAO

I dont have time to look into all the Media Manager issues this weekend. Its meant to be a holiday, but here I am at 21:28 drinking espresso and opening my IDE.

avatar dgrammatiko
dgrammatiko - comment - 26 Aug 2021

I dont have time to look into all the Media Manager issues

Quick recap: the media manager repo when abandoned had around 100 open issues
I have a personal list of issues that are ranking from annoying bugs to serious sh**t

That doesn't mean that the media manager is bad, actually, it's the best implementation in the Joomla world (I've tested the others and they are 10 years behind). BUT needs hands to fix and implement whatever the MM team left half-baked...

avatar PhilETaylor
PhilETaylor - comment - 27 Aug 2021

Quick recap: the media manager repo when abandoned had around 100 open issues

Im no Javascript / Vue expert. I can only contribute minor fixes to javascript and fixes to the PHP side... and not 100 at a time :)

avatar HLeithner HLeithner - change - 7 Jan 2022
Labels Added: J4 Media Manager
avatar HLeithner HLeithner - labeled - 7 Jan 2022
avatar brianteeman
brianteeman - comment - 24 Feb 2022

OK its not a bug then just not designed to do this.Good stuff lads.

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35386.

This should be closed now

avatar Quy Quy - change - 24 Feb 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-02-24 15:58:54
Closed_By Quy
avatar Quy Quy - close - 24 Feb 2022

Add a Comment

Login with GitHub to post a comment