• Gabriel

    (@gafma)


    Hello, I am in trouble here.

    I need to resize images from code. In your troubleshoot i found a way that says to use the function imsanity_handle_upload($params). But does not work. Changes nothing and there is not way to see any kind of debbuging. It does not seem to be any kind of error, but does not work.

    Is a sample of code out of wordpress, where i call it through require_once(wp-load.php). I think it is not influencing in nothing. Is a WPMU installation where the plugin works fine about the common way.

    $targetPath =wp_upload_dir();  //4
    //$name  - file | $ds - directory separator
    $targetFile =  $targetPath['path'].$ds. $name;
    move_uploaded_file($tempFile,$targetFile); //works fine
    $params['type'] = image_type_to_mime_type(exif_imagetype($targetFile));
    
    $params['file'] = $targetFile;
    
    $params['url'] = $targetPath['url']."/".$name;
    imsanity_handle_upload($params);

    Thanks in advance

    https://www.ads-software.com/plugins/imsanity/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Gabriel

    (@gafma)

    I solved this.
    The option ‘Images uploaded elsewhere (Theme headers, backgrounds, logos, etc)’ in plugins settings must be configured to a non-zero value to imsanity_handle_upload($params); to work.

    rezeile

    (@eliezerloubak)

    Hello Gabriel, how are you?

    Brother’m in trouble to send (upload) pictures to my site, I need function to decrease the amount of MB automatically, ie if the image to send (upload) is 5mb I need her to be altomaticamente in 500kbps.

    I am searching the forum on the subject but have not yet found a solution … as I am not a programmer I need help to solve this problem.

    Regards,

    Eliezer (I speak Portuguese and Spanish, my English is horrible .. sorry)

    Thread Starter Gabriel

    (@gafma)

    Well, you are using this plugin (imsanity)? It solves exactly this problem.

    Portuguese
    Bom, você está usando este plugin (imsanity)? Ele resolve exatamente este problema.

    BR

    ????????????▄▄
    ???????????█??█
    ???????????█??█
    ??????????█???█
    ?????????█????█
    ███████▄▄█?????██████▄
    ▓▓▓▓▓▓█??????????????█
    ▓▓▓▓▓▓█??????????????█
    ▓▓▓▓▓▓█??????????????█
    ▓▓▓▓▓▓█??????????????█
    ▓▓▓▓▓▓█??????????????█
    ▓▓▓▓▓▓█████?????????█
    ██████???????██████?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Need to resize from code’ is closed to new replies.