e107 icon indicating copy to clipboard operation
e107 copied to clipboard

theme installation - authomatic images upload

Open Jimmi08 opened this issue 6 years ago • 5 comments

Hi, I have never noticed this before, maybe it's there long time. But when you install new theme, it scans the folder and upload to media manager all images.
Nice feature but why it doesnt scan only images or install folder? I have theme with a lof of assets and it uploaded maybe 200 images when in fact I need to use maybe 5. Where to put those images to avoid automatic upload during theme installation? Thanks

Jimmi08 avatar Sep 17 '18 08:09 Jimmi08

Have you tried to create another folder inside your theme, named like, for instance, images.tmp?

rica-carv avatar Sep 17 '18 16:09 rica-carv

@rica-carv I checked code before this issue. There is regex for this, so renaming folder will not help.

image

Fresh installation, there is folder with assets called inset.

image

This is great future for install folder. I should have a way to control what is uploaded.

Jimmi08 avatar Sep 18 '18 06:09 Jimmi08

$med = e107::getMedia();
			$med->import('_common_image', e_THEME.$name, "^.*?logo.*?(\.png|\.jpeg|\.jpg|\.JPG|\.GIF|\.PNG)$");	
			$med->import('_common_image', e_THEME.$name, '', 'min-size=20000');

default for second import: [a-zA-z0-9_-]+\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF)

It imports every image in the theme folder. Could you explain to me reason for this? I understand folders install, images, img, but not everything.

Where to put theme assets if I don't want to upload them to media manager?

Thanks

Jimmi08 avatar Feb 14 '20 10:02 Jimmi08

@Jimmi08 The first one imports any files marked containing 'logo' in the filename. The 2nd imports any images over 20000 kb (or it could be bytes, I don't remember) I believe the 2nd one needs to be fixed so that it looks only inside the 'install' folder.

CaMer0n avatar Feb 20 '20 15:02 CaMer0n

Not sure if this is correct fix, tested on windows only.

image

$med->import('_common_image', e_THEME.$name."/install/", '', 'min-size=20000');

Either close this issue as not planned or fix it, please. Thanks.

Jimmi08 avatar Jan 30 '24 11:01 Jimmi08