/
files/
images/
other stuff/images/
This question has been answered by Bruno17. See the first response.

[[*imageFile1]]
<?php $imageregular = 'assets/files/images/' . $image; //the string added to image is the temporary fix $closing = $end; include 'php/fullimage_auto.php';
<?php
include('php_image_magician.php'); //including image magician EDIT must be in SAME FOLDER AS THIS FILE
#isolating the filename without the directory folders
$imagesize = getimagesize($imageregular); //getting image size of original image
$nopath_spaces = pathinfo($imageregular, PATHINFO_BASENAME); //getting filename itself - spaces and all
$nopath = $string = preg_replace('/\s+/', '', $nopath_spaces); //stripping filename of any spaces that will break the image
$path = pathinfo($imageregular, PATHINFO_DIRNAME) . "/"; //path itself
$savepath = $path . pathinfo($nopath, PATHINFO_FILENAME); //if designated, this will save in a folder named the same as the original image
if (!is_dir($savepath)) // if the name of the file is a not also ALREADY a folder
{
mkdir($savepath); //create a new folder
}
$id = uniqid(); //generating unique ID
//creates large image - first checks that default image is not already 1920 x 500. If it is not, it will resize the file, crop it, and overwrite it.
if (!file_exists($savepath . '/' . 'large' . $nopath))
{
$imagelarge = new imageLib($imageregular);
if ($imagesize[0] != 1920 && $imagesize[1] != 500){
$imagelarge -> resizeImage(1920, 1080, 'crop');
}
$imagelarge -> saveImage($savepath . '/' . 'large' . $nopath, 60);
}
if (!file_exists($savepath . '/' . 'small' . $nopath))
{
$imagesmall = new imageLib($imageregular);
$imagesmall -> resizeImage(1280, 350, 'crop');
$imagesmall -> saveImage($savepath . '/' . 'small' . $nopath, 60);
}
if (!file_exists($savepath . '/' . 'mobile' . $nopath))
{
$imagemobile = new imageLib($imageregular);
$imagemobile -> resizeImage(630, 250, 'crop');
$imagemobile -> saveImage($savepath . '/' . 'mobile' . $nopath, 60);
}
?>
<script type="text/javascript">
$(document).ready(function(){
imagesizer();
});
$(window).resize(function() {
imagesizer();
});
function imagesizer(){
var width = $(window).width(); //widths are -15px because of the scrollbar
if(width<=615){
$("#<?php echo $id;?>").css("background-image", "url(<?php echo $savepath . '/' . 'mobile' . $nopath;?>)");
}else if(width>=615 && width<1265){
$("#<?php echo $id;?>").css("background-image", "url(<?php echo $savepath . '/' . 'small' . $nopath;?>)");
}else if(width>1265){
$("#<?php echo $id;?>").css("background-image", "url(<?php echo $savepath . '/' . 'large' . $nopath;?>)");
}
}
</script>
<div id="<?php echo $id;?>" class="bg">
<?php if (closing == false)
{
echo '</div>';
}
?>/assets/files/images/./headerimage.jpg

$imageregular = str_replace('./','',$image);