Showing full image proportions after user uploads an image

This topic contains 10 reply and 4 voices, and was last updated by paperweight 10 years, 5 months ago
Viewing 10 Posts - 1 through 10 (of 10 total)
Author Posts
October 23, 2013 at 9:02 pm 9340
paperweight 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?
October 23, 2013 at 11:27 pm 9343
Tareq Hasan Tareq Hasan

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.

October 25, 2013 at 10:00 pm 9442
paperweight paperweight

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)
}
October 25, 2013 at 10:06 pm 9444
paperweight paperweight

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”.

November 8, 2013 at 12:28 am 9841
Martijn Martijn

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

November 8, 2013 at 6:12 am 9849
paperweight paperweight

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?

November 8, 2013 at 6:14 am 9850
paperweight paperweight This reply has been marked as private.
November 11, 2013 at 1:38 am 9938
Tareq Hasan Tareq Hasan

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?

November 11, 2013 at 4:54 am 9941
paperweight paperweight

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));

November 11, 2013 at 6:58 am 9943
Mahi Mahi

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?

November 11, 2013 at 9:30 pm 9951
paperweight paperweight

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 10 Posts - 1 through 10 (of 10 total)