Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I have a limit on image size (800ko), and when importing bigger images, Acidfree tells me they are too big but it creates an empty image anyway ,with the file name as a title.
Comment | File | Size | Author |
---|---|---|---|
#1 | node_from_file_size_check.patch | 475 bytes | vhmauery |
Comments
Comment #1
vhmauery CreditAttribution: vhmauery commentedI assume this is on mass import? The mass import stuff has been rewritten to work with the new image_create_node_from function. This, however, will allow you to create a file larger than the max image size too, but it does it correctly.
I am re-assigning this to the image module and posting my patch to fix it since this is a workaround to the max file size.
Comment #2
Hetta CreditAttribution: Hetta commentedMarked http://drupal.org/node/231753 as duplicate - that's 6.x-dev, though.
Comment #3
vhmauery CreditAttribution: vhmauery commentedmarked http://drupal.org/node/242911 as duplicate.
Comment #4
drewish CreditAttribution: drewish commentedmarked #244751: No warning displayed if filesize too big. Just 'OK, your image was created' ... NOT! as a duplicate.
this needs to be committed to 6.x first and then backported to the 5.x-2.x branch.
Comment #5
dman CreditAttribution: dman commentedPatch above is not much help. It simply disables filesize restrictions altogether.
I presume thats not really what we want to do.
I want to see an error flagged and the image-save aborted.
For other cases, perhaps an override checkbox could be provided.
In all cases, I think creating a null image node is the wrong behaviour.
Comment #6
vhmauery CreditAttribution: vhmauery commenteddman,
I don't think you read the patch correctly. The patch doesn't disable filesize restrictions, it enforces them. It does half of what you want. It aborts without creating a null image node. The thing it doesn't do is logging (I leave that as an exercise to the caller).
Comment #7
dman CreditAttribution: dman commentedYou're right, I didn't read well.
I saw '-' where there was '+' and thought it was just a temporary work around. Sorry!
Comment #8
drewish CreditAttribution: drewish commenteddidn't test this but the indenting is being done with a tab rather than spaces...
Comment #9
sunThis seems to have been fixed already.
If I'm mistaken, then incorporate the required fix into #298702: Properly validate image uploads, please.