Home Forums Plugin Support WP User Frontend Pro Showing full image proportions after user uploads an image

This topic is: resolved

Tagged: , ,

This topic contains 10 replies, has 4 voices, and was last updated by  paperweight 5 years, 7 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #9340

    paperweight
    Participant
    Post count: 122

    When a user uploads an image, a square box is then displayed with the image. However, if the image is rectangle, then parts of the image are cutoff.

    Is there a way to show a smaller version of the image, but still retain its proportions? Maybe, for example, keep it to a maximum of “height=120 px” or something like that?

    #9343

    Tareq Hasan
    Keymaster
    Post count: 2831

    When you upload the image, WP generates several image sizes registered to
    it. WPUF shows the thumbnail version. If some parts are cutoff, may be it's
    doing a hard crop to manage that size.

    If you want to down scale it, I would suggest to do it via CSS. Shouldn't
    be tough.

    #9442

    paperweight
    Participant
    Post count: 122

    Thanks but I don't think CSS helps since the image itself is delivered as a thumbnail via PHP.

    But I solved this accidentally since I created a function elsewhere. In your WPUF Pro “Featured Image size”, it displays results from the functions.php if you add something like this:

    if ( function_exists( 'add_image_size' ) ) { 
    	add_image_size( 'category-thumb', 300, 9999 ); //300 pixels wide (and unlimited height)
    	add_image_size( 'homepage-thumb', 220, 180, true ); //(cropped)
    }
    #9444

    paperweight
    Participant
    Post count: 122

    But one tip for the developers:

    It would be great if we could replace the default image with something else a different size if the Post does not have an image if we select “Show Featured Image”.

    #9841

    Martijn
    Participant
    Post count: 2

    Is it possible to a bigger image size, maybe for example the wp default medium size?

    #9849

    paperweight
    Participant
    Post count: 122

    Hmmm, I just found that I still have a small issue with images. Form the backend and from WPUF, uploading appears fine, but on the frontend, the images are still thumbnails and I can;t seem to fix them. I have tried CSS and changing PHP code, but the actual size appears set on the backend. My meaning is it is not being affected by CSS. Can I send you a link to a sample page so you can take a quick look at it?

    #9850

    paperweight
    Participant
    Post count: 122
    This reply has been marked as private.
    #9938

    Tareq Hasan
    Keymaster
    Post count: 2831

    Sorry for replying late. But I don't see any reason why the small image is being set as feature image. WPUF doesn't do any scaling by it's own and sets the featured image as it was originally uploaded. Are you printing the image in a smaller version in your theme?

    #9941

    paperweight
    Participant
    Post count: 122

    Thanks for your help. For each Post we have 1 featured image and up to 3 other images. So in the WPUF Form I have 2 areas for image uploads: one is the featured image upload and the second is the area to upload the other 3 images. The reason we must use one featured image is because other plugins and themes incorporate a Featured Image without tweaking.

    OK, I solved this ๐Ÿ™‚ I did something stupid and was not paying attention to my code. In my PHP for that image I had this:

    $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), array(160,60));

    So I changed it to this and it now works fine and shows the full size image (up to 2048 pixels):
    $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), array(2048,2048));

    #9943

    Mahi
    Member
    Post count: 1555

    Glad to know you got it works ๐Ÿ™‚

    PS: Just wondering are you really allowing users to upload 2048px width & height max images?
    Doesn't it slowing down the site? i mean how do you handle it?

    #9951

    paperweight
    Participant
    Post count: 122

    Yes 2048px are fine for us since these open as new windows now and we will soon make them open in a lightbox. These are often high-resolution images that companies want to post, so the originals are available to users. We have a maximum 1MB size too. Most images will not be 2048px but we want to still give users that option~

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘Showing full image proportions after user uploads an image’ is closed to new replies.