Resize Image Custom Field
This topic contains 14 replies, has 4 voices, and was last updated by Paolo 9 years, 10 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
December 28, 2015 at 9:23 pm #65595
Hi
I just created a new custom field in place settings.
The field is a file upload function and I want members to upload an image to the place listing. However, I also want to resize that image to a given size.Let’s say I want to display an image of 400x100px size even if they are uploading a 2000x800px image.
I know the function is somewhere but I can’t find it.
Any suggestions?Thank you!
December 28, 2015 at 11:54 pm #65612You would have to add some CSS like this:
.geodir-custom-post-gallery .geodir_thumbnail {width: 400px; height: 100px;}To get more precise we’d need to have a URL of a listing where we can see this.
December 29, 2015 at 12:04 am #65615I was using this code on my dev site (therefor no link) but it didn’t worked very well.
It was forcing this image to have this one size or the other which makes the image look strange when it is stretched or squeezed.I’m not sure if this is how it should work, it was just my best guess.
Would it be possible to just use the “large” image and use a part of it for the “small” image without resizing or cropping it?December 29, 2015 at 12:15 am #65618It is only the large image that is used. With the CSS you only affect how it is shown on the page, any CSS code does not resize or crop the image itself.
The image you see on the detail page is just the real image but scaled with CSS.December 29, 2015 at 12:19 am #65619Alright, now that makes sense. So I should better make sure images are uploaded in the given size or in a ration where the scaling doesn’t destroy the “view” of the image.
Thank you so much for your help Guust!December 29, 2015 at 12:23 am #65620You’re welcome 🙂
December 29, 2015 at 3:09 pm #65671This reply has been marked as private.December 29, 2015 at 4:12 pm #65683Hi,
of which image on that page are we talking about?
Let us know,
Thanks
December 29, 2015 at 10:15 pm #65754Like Paolo says, where are your uploaded images on that page?
December 29, 2015 at 10:54 pm #65761Sorry, seems I missed the replies here.
I’m currently not uploading images. I have used the “upload field” but I have to find out how to use the if function in case there is no image uploaded first.If an image is uploaded, it should be shown, if not, the “area” where it usually will be displayed, shouldn’t be shown as “empty”. Currently, if I don’t have an image, it shows a large white space.
December 29, 2015 at 11:07 pm #65765This is how it would show if you use all the default settings:
http://geo.goldroo.net/accommodation/australia/queensland/brisbane/hotels/the-sleep-inn/#post_info
If nothing is uploaded, the tab or field should not even show.December 29, 2015 at 11:17 pm #65767This reply has been marked as private.December 30, 2015 at 3:47 pm #65931Have you tried giving width and height : auto with CSS?
That should do the trick when there is no picture.
If you provide a link where I can see the placeholder without image, I’ll make sure to give you exactly the code you need.
Thanks
December 30, 2015 at 4:16 pm #65938Hi Paolo
I’ve tried auto before but I would like to force the size since I want to avoid smaller images at that place. So auto would kill that option. I’m currently giving the spot/image a predefined size via css.
Right now I can’t give you a link since it is local, I might move it to my online dev server.December 30, 2015 at 5:35 pm #65959We’ll be here…
Thanks
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket