• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space

HOW to change cover image upload size ?

knova15

💖 Chevereto Fan
HI

Where is the setting for the cover image file size ? 🙂 Cant find it anywhere 😀 lol


thx
 
Home page? Or User?I assume you mean user-background and not what is classed as the cover...
Cover: In your theme CSS look for #home-cover, if it's not there simply add it. Then just define the size manually. Ideally if you use an image you won't want the gradient...
 
Last edited:
Home page? Or User?
Not everything needs to be a setting. In your theme CSS look for #home-cover, if it's not there simply add something like the following (give or take on the padding). Then just define the size manually. Ideally if you use an image you won't want the gradient...
Code:
#home-cover {
    width: 100%;
    padding: 100px 0 100px 0;
    background-image: url(LINK HERE');
    color: #FFF;
}


thx but im looking for the img file size....currently its 1Mb max
 
In themes/Peafowl/footer.php Try it and let me know if it works.
PHP:
CHV.obj.config = {
    image : {
        max_filesize: "<?php echo CHV\getSetting('upload_max_filesize_mb') . ' MB'; ?>"
    },
    user: {
        avatar_max_filesize: "1 MB",
        background_max_filesize: "1 MB"
    }
};

I think you need to change avatar_max_filesize because the JS calls that.
PHP:
        if(user_file.size > CHV.obj.config.user.avatar_max_filesize.getBytes()) {
            PF.fn.growl.call(PF.fn._s("Please select a picture of at most %s size.", CHV.obj.config.user.background_max_filesize));
            return;
        }

I've had trouble uploading images larger than 1.5mb they don't seem to want to go.
 
Last edited:
Is hardcoded in the js and in the backend.
Yeah... I noticed this tidbit but even changing that I'm still having trouble getting it to upload files over 2mb.
PHP:
CHV.fn.uploader = {
   
    options: {
        image_types: ["png", "jpg", "jpeg", "gif", "bmp"],
        max_filesize: "2 MB"
    },
 
That doesn't do anything really...

app/lib/chevereto.js
Code:
        if(typeof CHV.obj.config !== "undefined" && typeof CHV.obj.config.image !== "undefined" && CHV.obj.config.image.max_filesize !== "undefined") {
            this.options.max_filesize = CHV.obj.config.image.max_filesize;
        }

The 2 MB thing is just in case the injected options from footer are not there.

The thing for the javascript is this (app/themes/Peafowl/footer.php)
Code:
CHV.obj.config = {
    image : {
        max_filesize: "<?php echo CHV\getSetting('upload_max_filesize_mb') . ' MB'; ?>"
    },
    user: {
        avatar_max_filesize: "1 MB",
        background_max_filesize: "1 MB"
    }
};

And this one is for the backend (app/lib/classes/class.user.php
Code:
$image_upload = Image::upload($source, $user_images_path, ($type == 'avatar' ? 'av' : 'bkg').'_' . strtotime(G\datetimegmt()), ['max_size' => G\get_bytes('2 MB')]);
 
Back
Top