Did install correctly, copied plup library set the image field to plupupload

when i drag images in the image drag frame the first image pops up full screen and nothing happens

is this normal, I guess not

Comments

tacoparty’s picture

I had the same problem but I agree this looks like a great module once it's working correctly. I was sort of able to use it with a node that already had about 10 images attached to it. When I switched the widget to Pupload I was able to see the already uploaded images in the node edit area. I just can't upload or add images with it, which I guess is kind of the point. But I think this will be great once the kinks are worked out.

thaistore’s picture

yes exactly same problem, but why is this released if not tested, now I have to disable everything

Anonymous’s picture

I've just downloaded version from here and tested it and it works just fine(I've tested it at work so not at my home computer).

Plupload has it's own permission, don't forget to enable it if you are not admin. Otherwise you'll get (probably http) error in queue.

What about when you select images without dragging them but selecting them as usual instead?

tacoparty’s picture

Setting a maximum file size and resolution made it work for me, and it works great. Exactly what I've been looking for for a long time, works great!

Anonymous’s picture

Wait until d.org regenerate new dev package(newer than 16 jan.). There is bugfix for this.

franzkewd’s picture

@ #5. The dev package available now is 19 Jan.
Nice module, can't wait to test.

Cheers

thaistore’s picture

if i just select images, nothing happens.........

if i click on add button, nothing happens, is this beause of a browser? I use chrome

thaistore’s picture

update, i installed latest dev 21 jan, THIS IS JUST AMAZING!!!!

ivanjaros SHOULD GET A BRONZE STATUE FOR THIS MODULE

THANK YOU SO MUCH!!!!! DRUPAL 7 IS NOW COMPLETE BECAUSE OF YOU ivanjaros

Beaker633’s picture

Make sure you have the latest (from tonight) installed.

thaistore’s picture

i just tested it again, i get this error

Notice: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: premature end of data segment in image_gd_load() (line 237 of /home3/med/public_html/mrelax/modules/system/image.gd.inc).

Beaker633’s picture

OK, so was still getting errors (although the drop tonight worked much better). The error on the screen is just 'HTTP' error....

To diagnose, I changed the plup_plup_file_validation_alter method to:

/**
 * Default validation function.
 * In most cases Pluplaod will be used for images so we use image-specific validation.
 * Non-image files has no support right now.
 */
function plup_plup_file_validation_alter(&$file, &$e) {
  if (!isset($file->arg) || (isset($file->arg) && is_numeric($file->arg))) {
    $instance = db_select('field_config_instance','i')->fields('i', array('data'))->condition('id', $file->arg)->execute()->fetchField();
    $instance = unserialize($instance);
    $settings = $instance['settings'];
    $e = array_merge($e, (array) file_validate_is_image($file));
    $e = array_merge($e, (array) file_validate_extensions($file, $settings['file_extensions']));
    $e = array_merge($e, (array) file_validate_size($file, parse_size($settings['max_filesize']), 0));
    $e = array_merge($e, (array) file_validate_name_length($file));
    $e = array_merge($e, (array) file_validate_image_resolution($file, $settings['max_resolution'], $settings['min_resolution']));
    if (count($e)>0){
 		watchdog('plup error', print_r($e, TRUE));
 	}    
  }
}

The error was:The file is 278.13 KB exceeding the maximum file size of 1 byte.
Looking at the code.. the file size method expects an integer, the setting is '1 MB'.
I will investigate a fix and post when I have one, but it's nearly bedtime :)

update .. found that parse_size handles the issue.,, updated the code above. It now works for me.

Great module!!!

W.M.’s picture

I will happily test this module today after I return home by God's will. I hope it integrates fine with insert and filefield paths modules. Any ideas?

Thanks very much developer. Will happily test it.

Anonymous’s picture

thaistore - it sounds that the error has nothing to do with the module.
Beaker633 - That's interesting. I've tested it many times and it always worked but when you look at the file_validate_size there definitely has to be number. Weird.

thaistore’s picture

Hmmm i still get issues, i can upload them, i can see images are there but when i click save I get this error

Notice: Trying to get property of non-object in file_field_presave() (line 220 of /home3/altermed/public_html/relax/modules/file/file.field.inc).
Notice: Undefined property: stdClass::$uri in file_save() (line 573 of /home3/altermed/public_html/relax/includes/file.inc).
Notice: Trying to get property of non-object in file_field_presave() (line 220 of /home3/altermed/public_html/relax/modules/file/file.field.inc).
Notice: Undefined property: stdClass::$uri in file_save() (line 573 of /home3/altermed/public_html/relax/includes/file.inc).
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'uri': INSERT INTO {file_managed} (filesize, status, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 0 [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => 1327144004 ) in drupal_write_record() (line 6888 of /home3/altermed/public_html/relax/includes/common.inc).

what can this mean?

sam6’s picture

It works for me. Ivanjaros should get a golden statue for this.

Thank you so much!

Anonymous’s picture

thaistore - try the module on fresh installation without any contrib modules to see if you get the same error(try it on the same server).

mathiasgmeiner’s picture

First of all: Thanks for this fantastic module!

I had the same issue as Beaker633 http://drupal.org/node/1411018#comment-5496310
I used your code and modified it like Beaker633, now everything works as expected!

$e += file_validate_is_image($file);
$e += file_validate_extensions($file, $settings['file_extensions']);
$e += file_validate_size($file, parse_size($settings['max_filesize']), 0);
$e += file_validate_name_length($file);
$e += file_validate_image_resolution($file, $settings['max_resolution'], $settings['min_resolution']);

When you are trying to upload images as user 1 (uid = 1) then file.inc bypass the validation, so no error for uid 1:

// Bypass validation for uid  = 1.
if ($user->uid != 1) {
    if ($file_limit && $file->filesize > $file_limit) {
      $errors[] = t('The file is %filesize exceeding the maximum file size of %maxsize.', array('%filesize' => format_size($file->filesize), '%maxsize' => format_size($file_limit)));
}

// Save a query by only calling file_space_used() when a limit is provided.
if ($user_limit && (file_space_used($user->uid) + $file->filesize) > $user_limit) {
      $errors[] = t('The file is %filesize which would exceed your disk quota of %quota.', array('%filesize' => format_size($file->filesize), '%quota' => format_size($user_limit)));
    }
}
Anonymous’s picture

I've added the parse_size function.

Anonymous’s picture

Title: This looks awesome » Non-admin user won't pass file size validation
Status: Active » Closed (fixed)

I'm closing this. Please create one ticket per issue nex time.