BuzzingPixel

Ansel for Craft

Ansel for EE

Treasury

Construct

Category Construct

Dashboard (open an issue here)

All Issues

My Issues

News Contact
Log in

Logged in as

Licenses Purchases Profile Change Password Billing Portal Admin
Log Out
Software
Ansel for Craft Ansel for EE Treasury Construct Category Construct
Support
Dashboard (open an issue here) All Issues My Issues
News Contact
Log in
Logged in as:
Licenses Purchases Profile Change Password Billing Portal Log Out
Dashboard All Issues My Issues
Support Dashboard
  1. Home
  2. Home
  3. Support Dashboard
  4. View Issue

Image size

#198 opened by Res Naegeli

Subscribe

Details

See Comments

Public Issue

Visibility: Public
4 replies
Last reply by Res Naegeli
Created 4/22/2021 8:37 AM
Updated 4/22/2021 10:16 AM
Ansel for ExpressionEngine 2.2.0
CMS Version: EE 5.4.2

Description

Hi How to prevent the client to upload heavy images (i.e. 11 MB)? Is there a way Ansel can downsize the image when uploading it? Thanks

Replies

  • TJ Draper

    Replied 4/22/2021 10:05 AM, Edited 4/22/2021 10:16 AM

    Ansel cannot/does not prevent the uploading and using of whatever size image the user wants (unless it's under the requirements for the field). However, you should not be outputting that un-optimized image on the front-end of your website. This is kind of the crux of Ansel and the point. The field should define min/max constraints (and you can also use on-the-fly manipulations with the template tags). This removes the need for the user to know or care about image sizes. Ansel stores the original image, then creates an optimized version of the image.

    See the following for more details:

    https://buzzingpixel.com/software/ansel-ee/documentation/field-type-settings#uploadSaveDirectories

    https://buzzingpixel.com/software/ansel-ee/documentation/template-tags#onTheFly

  • Res Naegeli

    Replied 4/22/2021 10:07 AM, Edited 4/22/2021 10:16 AM

    Addition: I found the possibility within EE docs:

    If you have defined any image manipulations you can modify the tag with the Short Name of the manipulation. For example, if you’ve defined a “small” manipulation, the following will output the URL to that version: {news_image:small}

    When I use this with the Ansel tag adding the short name (:large) no image will be shown

    {!-- Output images --}
    {my_ansel_field:large}
    	{img:url}
    {/my_ansel_field:large}
    

    What is wrong? Thanks

  • TJ Draper

    Replied 4/22/2021 10:10 AM, Edited 4/22/2021 10:16 AM

    Your code does not match the documentation.

    https://buzzingpixel.com/software/ansel-ee/documentation/template-tags#tagPairVarialbes

    You would need to do as follows (per the documentation)

    {my_ansel_field manipulations="true"}
        {img:large:url}
    {/my_ansel_field}
    
  • Res Naegeli

    Replied 4/22/2021 10:16 AM

    Great, I see... thanks a lot :)

Use Markdown for formatting

Details

See Comments

Public Issue

Visibility: Public
4 replies
Last reply by Res Naegeli
Created 4/22/2021 8:37 AM
Updated 4/22/2021 10:16 AM
Ansel for ExpressionEngine 2.2.0
CMS Version: EE 5.4.2
Cookie Policy
Privacy Policy
Terms of Service

© 2023 BuzzingPixel, LLC. All rights reserved.