• Hi Iulia,

    Thank you for your wonderful plugin!

    I can see it allows one to configure it to work on particular post-type attached images (when uploading the image to a certain blog post category, for example).

    Is it possible to configure it to work based on a particular page, or form/form field where the image is uploaded?

    As I have a website where users will be uploading images via a specific page (or form/form field), which I want to be compressed and resized to a specific dimension (in this case, an A4 poster aspect ratio).

    I look forward to your reply and confirmation.

    Thank you,

    Luke

    PS. I imagine this could be done with custom script, is that right? Please let me know and I can get my developer to take a look at this. Thank you ????

    PPS. It would be ideal if it could be done based on form field, actually, as I may allow uploading of other images on the same form/page, which would not require this aspect ratio, and would require there own unique aspect ratio.

    • This topic was modified 1 year, 3 months ago by lukekowald.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Iulia Cazan

    (@iulia-cazan)

    Hi,

    The plugin’s advanced rules tab offers options for applying these based on post ID. Have you tried that?

    There is also one custom hook you could use, this is an example:

    // Example of filter.
    add_filter( 'sirsc_custom_upload_rule', your_custom_settings, 10, 6 );
    
    function your_custom_settings( $settings, $id, $type, $parent_id, $parent_type ) {
        // Do you code that adds custom rules...
    
        return $settings;
    }

    Hope this helps.

    Regards,
    Iulia

    Thread Starter lukekowald

    (@lukekowald)

    Hi Iulia,

    Thanks for the info.

    FYI, I have tried the advanced rules to apply the specific image resizing I want based on post ID (this is a page linked with my event manager plugin, that has a post ID of 536).

    But when I set this up, as per the attached screenshot, it does not work.

    I have also tried adding the settings for ‘Settings for images attached to a event_listing’ (which I assume should be my event manager plugin page/custom post type), but this also does not result in the specified image sizes being generated, only the default general settings.

    The image sizes I want for images added via this event plugin upload page (post ID 536) are 2048 x 2896, 1024 x 1448 and 1200 x 630 for featured image size), for now.

    That said, I have turned on global ignore on all images except one (2048 x 2048) within the ‘general settings’, but then turned on global ignore for all images other than the ones I want on the ‘Settings for images attached to a event_listing’. I am assuming the ‘general settings’ would NOT overwrite the ‘specific post settings’, is that correct?

    At the end of the day, I would like images uploaded via media file upload or other locations to only fit within the one image size of 2048 x 2048 (forcing as original), and to NOT ALSO resize to my poster image sizes listed above.

    And concurrently, I want all images uploaded via event upload page to ONLY be in the respective file sizes specified (and not the general 2048 x 2048 dimensions).

    How can I get this to work, please?

    Thank you,

    Luke

    Screenshots for your reference are below:

    General settings: https://www.dropbox.com/scl/fi/1aeo4zlswzmuayk8iy0n6/General-settings.png?rlkey=jbama5h2m3y2qdgh67a8qymb1&dl=0

    Settings for images attached to a event_listing: https://www.dropbox.com/scl/fi/1aeo4zlswzmuayk8iy0n6/General-settings.png?rlkey=jbama5h2m3y2qdgh67a8qymb1&dl=0

    Advanced rules: https://www.dropbox.com/scl/fi/peer7lywigahr6b9sxvpj/Advanced-rules.png?rlkey=5yc0yvl3qq9gi1c05purq4uon&dl=0

    Thread Starter lukekowald

    (@lukekowald)

    FYI, I can see there are other options in advanced rules, such as ‘event categories’, but I’m wary of using this option, as it appears one has to explicitly enter each specific category, and I don’t want to have to do that, as categories may grow over time and I don’t want to have to remember to explicitly manually add them.

    https://www.dropbox.com/scl/fi/64umgj9tmsu4bg8dzxdrm/Other-advanced-rules.png?rlkey=6qndo4fwnrrrs1x4o28u61n51&dl=0

    Thread Starter lukekowald

    (@lukekowald)

    Also, how does the ‘APPLY THE SETTINGS BELOW FOR THE SELECTED OPTION’ section work?

    It states the options will ‘apply to the images attached to a post’.

    Does that mean one has to ‘upload’ the image explicitly via that post?

    Or can they upload the image via media files upload, and afterward if attached to that specific post type, then the image will be resized as per the specifications? I don’t imagine this option is correct, as I feel that images get resized on upload, no?

    If you could please clarify, that would be great.

    Also, one more question, but what does ‘turn off the WooCommerce background thumbnails regenerate’ actually mean? I have the ‘execute bulk actions using the WordPress cron tasks instead of the default interface’ turned on.

    Thank you.

    https://www.dropbox.com/scl/fi/zw9qebu1vm18ht43l0zv3/APPLY-THE-SETTINGS-BELOW-FOR-THE-SELECTED-OPTION.png?rlkey=lxotjxbrs60l1c6s0826uwytq&dl=0

    Thread Starter lukekowald

    (@lukekowald)

    And with regard to the custom hook you shared before, I imagine that is only capable of basic resizing (such as image width, height and crop mode) and not the advanced functions that your plugins provides (like generate only perfect fit sizes, attempt to upscale when generating only perfect fit sizes, force original, and all the other various settings), is that correct?

    Thread Starter lukekowald

    (@lukekowald)

    Hi Iulia,

    Hope you’ve had a good holiday break.

    Would love to hear back from you on this one, when you’re able.

    Kindly,

    Luke

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Is it possible to configure it to work based on a particular page/form?’ is closed to new replies.