WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: NextGEN Gallery] No image resize (9 posts)

  1. Sumit1988
    Member
    Posted 5 years ago #

    Hi guys

    I use NGG a long time now. THe following problem exists everytime for me.
    NGG is not resizing images! I want them to 800x600 but they are still 3xxx x 2xxx Pixel. So the img-loading is very slow.

    In older versions i solved the problem with this:

    Editing the /wp-content/plugins/nextgen-gallery/admin/wp25/functions.php
    Search for the function upload_images()
    Scroll down after the end of the loop and check for this code:
    //create thumbnails
    nggAdmin::generatethumbnail(WINABSPATH.$gallerypat h,$imageslist);
    BEFORE THAT add this:
    //create resized pictures
    nggAdmin::resizeImages(WINABSPATH.$gallerypath,$im ageslist);

    It worked. But in the new version of NGG there is no Folder named wp25.
    So how can i get the resize function to work?

    Server:
    Betriebssystem : Linux
    Server : Apache/2.2.3 (Red Hat)
    Speicherverbrauch : 23 MByte
    MySQL Version : 5.0.45
    SQL Modus : Nicht gesetzt
    PHP Version : 5.2.6
    PHP Safe Mode : Aus
    PHP Allow URL fopen : An
    PHP Memory Limit : 64M
    PHP Max Upload Größe : 24M
    PHP Max Post Größe : 24M
    PHP Max Script Execute Time : 30s
    PHP Exif Modul : Ja ( V1.4 )
    PHP IPTC Modul : Ja
    PHP XML Modul : Ja

    Ja=Yes, An=On, Aus=Off

    Sorry for my bad english!

    greetings

    Sumit

  2. Sumit1988
    Member
    Posted 5 years ago #

    ok why the hell did not anyone told me, that i ONLY can resize the images AFTER the upload? :D
    cmon i wasted 24 hours with google searching :-/

    Then idea: Image resize on upload would be cool!

  3. Alex Rabe
    Member
    Posted 5 years ago #

    Yes, but not possible... (With PHP, only with JAVA or OS based tools)

  4. micky2be
    Member
    Posted 5 years ago #

    Well you can do something ugly and dangerouse like adding
    nggAdmin::resize_image($image);
    as the first line of the function create_thumbnail($image) in the funtions.php file

  5. michaelstx
    Member
    Posted 5 years ago #

    I'm a little confused by this too. In the NGG options:images there is an image resize option. I assumed this meant the script would resize the uploaded images to that size on occasions when I uploaded larger size images. I usually resize myself before upload, so didn't know if this worked. Now I have other authors that want to upload images too. Not all are able (or think about) resizing first. I've discovered that setting image resize to 800x800 doesn't seem to resize the images after all. Is this option just not functional? Or does it only increase smaller images to the set size? Or have I missed something else I need to set to make this happen? Can anyone explain?

    Thanks

  6. Sumit1988
    Member
    Posted 5 years ago #

    @ michaelstx

    as i postet above: i got the same problem and didnt get, where the hell this resize-option is useable. But i got it now and you and your customers can use it without a new program oder anything.

    Just check this:
    Upload your images in any size. Which can be 50.000 x 6000PX or whatever. Now do your gallery stuff. Then go to "edit/manage gallery" and edit the new gallery. Just select ALL images in this gallery and select the action: "resize images" or something like that. Then the OK button and it will resize your images.

    This resize option is for resizing images after the upload. Understood?
    Have fun!

  7. chodorowicz
    Member
    Posted 4 years ago #

    thanks for this tips! I've been also wondering why the hell NGG is not resizing the images on upload. The way this option is stated it suggests that images would resized on the moment of upload

  8. adamch25
    Member
    Posted 4 years ago #

    For those interested, I have a code change that will make your images resize during the upload process to the sizes you specify in settings. Here's what to do:

    1) Open ~/wp-content/plugins/nextgen-gallery/admin/functions.php in your favorite text/code editor.

    2) Search for "// now create thumbnails" should be line 192.

    3) Insert just above the following code:

    // now create resized images
    foreach($image_ids as $r) {
    	nggAdmin::resize_image ( $r, 0, 0 );
    }

    4) Save.

    Cheers!

    Adam

  9. Ashton.Sanders
    Member
    Posted 4 years ago #

    @alexrabe: Are you serious? Your plugin is awesome, but that doesn't make any sense.

    @adamch25: Thank you. That worked for me perfectly. I will post again if there's any problems.

Topic Closed

This topic has been closed to new replies.

About this Topic