Home › Forums › Calendar Products › Community Events › Help with sizing uploaded image
- This topic has 8 replies, 3 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
July 17, 2013 at 11:42 am #55737
Daniella
ParticipantHi,
Is there a way to crop/scale down the size of uploaded images? Some images users are uploading are quite large. Thank you.July 17, 2013 at 12:16 pm #55748Barry
MemberHi Daniella,
I believe they are automatically resized according to the WordPress image settings (and to match any sizes defined by your theme or other plugins).
You can then dictate which of these sizes is shown to the end user by tweaking the single-event.php template (read up on themeing best practices first of all if you haven’t already done so!).
The line of code you would probably wish to change (within single-event.php) is this one:
<?php echo tribe_event_featured_image(); ?>Which you might change to:
<?php echo tribe_event_featured_image(null, 'medium'); ?>If for instance you wanted to display the medium sized version of the image. Does that help?
July 18, 2013 at 8:04 am #55857Daniella
ParticipantMaybe. What about limiting the size the user uploads in the first place from the form?
July 18, 2013 at 10:05 am #55897Barry
MemberThat’s a possibility, but right now our plugin simply follows the current practices of WordPress itself. If you feel strongly that it should be something our plugin should solve then definitely feel free to create a feature request for this:
https://tribe.uservoice.com/forums/195723-feature-ideas
Otherwise you would need to introduce a customization or workaround specific to your needs, whether that is an automated approach where the original size is deleted after upload (when and only when it comes through the community submission form), or else substituting a different upload mechanism that can crunch down and resize large images before they even leave the browser.
July 18, 2013 at 10:50 am #55908Daniella
ParticipantThe former sounds like a good idea: “an automated approach where the original size is deleted after upload (when and only when it comes through the community submission form)”. How would I accomplish that?
July 18, 2013 at 3:00 pm #55973Barry
MemberI’d love to help with that, but right now I can’t – we’re simply swamped with support requests right now and so a “nice-to-have” but what I understand to be non-essential customization like this unfortunately would have to wait until we have greater support bandwidth (and, it may be it is beyond the scope of support that we can offer in any case).
In broad outline though you might add a listener for the save_post action, determine if it is an event (and one being submitted via the community form), then loop through any attachments and delete the original sizes (for which your code may need to wait until a later point in the lifetime of the request).
I appreciate that’s a very high overview completely lacking in detail, nor is it the only strategy, but it could form part of a briefing if for instance you outsourced this work to an independent developer.
Cheers,
Barry
July 19, 2013 at 7:09 am #56068Daniella
ParticipantI understand. Thank you.
July 22, 2013 at 4:44 pm #56417Barry
MemberNot at all, sorry we can’t do more right now.
July 7, 2015 at 6:26 am #979342Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Help with sizing uploaded image’ is closed to new replies.
