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.
I have an imagefield_crop that I would like to have use one of three possible aspect ratios. Instead of making three fields and hiding the inactive ones, I'd rather just change the resolution with a hook.
Patch to follow.
Comments
Comment #1
jsagotsky CreditAttribution: jsagotsky commentedPatch provides hook_imagefield_crop_instance_alter, which allows you to modify the field instance right after it's loaded.
Comment #2
joetsuihk CreditAttribution: joetsuihk commentedThanks! Please have someone review this patch before I can commit this.
Comment #3
jsagotsky CreditAttribution: jsagotsky commentedMissed an instance where I needed to alter. Here's a rerolled patch.
Comment #4
RoySegall CreditAttribution: RoySegall commentedRe rolling
Comment #5
ram4nd CreditAttribution: ram4nd as a volunteer commented