1. vinnie
  2. General
  3. Monday, November 26 2018, 07:29 PM
Good evening.
I see that for the image field, I can set the size of the image. I guess, the image is automatically cropped for matching the chosen size.
However, what to do if I want to keep the image in its original size and not to change it at all with the upload?
Thanks.
admin Accepted Answer
Admin
Hi,
sorry this is not possible natively with Easy Profile. Do to this you need to make some changes:
- in file at /administrator/components/com_jsn/helpers/fields/image.php at line 182 and at line 192 you need to change from
$foo->image_ratio_crop = true
to
$foo->image_ratio_crop = false

Now with normal upload (no crop/webcam or something else) the parameter height/width will work as max-height/max-width
  1. more than a month ago
  2. General
  3. # 1
vinnie Accepted Answer
Thanks for your reply. This way, the image doesn't get cropped or compressed as long as it's within the max-height max-width, that's correct?
  1. more than a month ago
  2. General
  3. # 2
admin Accepted Answer
Admin
Hi,
the image will be resize to fit max-height or max-width, for example:
Image original size: 800x600
Setting field Width (max-width): 1024
Setting field Height (max-height): 1024

Result image will be 1024x768 (different size but same ratio)
  1. more than a month ago
  2. General
  3. # 3
vinnie Accepted Answer
So there's no way to leave the image as is, just like the "file" field type?
  1. more than a month ago
  2. General
  3. # 4
admin Accepted Answer
Admin
mmmh, nope, but you can use a workaround to do this with "file" field type and "HTML delimiter" field type.

follow these steps:
- Create a field of type "File" with alias "filefield" and set it to not show in profile page
- Create a field of type "HTML Delimiter"
- Set this field to not show in Profile/Edit Profile/Registration (it will be show only in profile page)
- Put in description this code (source code):
<img src="/{user filefield raw displayed}" />


HTML delimiter field type allow you to put a custom code in field position, it also support our Content Plugin that allow you to retrieve user data. So a string like {user filefield raw displayed} will be replaced with the url of the file.

With this way you will see value of "filefield" formatted as image in profile page, so basically File field type will be used to upload the file and HTML delimiter field type will be used to show the value.

Docs
HTML delimiter: http://docs.easy-profile.com/index.php/article/html-delimiter-field-type
Content Plugin: http://docs.easy-profile.com/index.php/article/content-plugin
  1. more than a month ago
  2. General
  3. # 5
vinnie Accepted Answer
Thank you so much, that's just what I needed.
I made it like this:

<img src="/{user filefield raw displayed}" height="250" />

so when the image is retrieved, even if very big, in the profile it's displayed with the max height of 250px, keeping the original ratio.
Thank you very much,
Have a good day!
  1. more than a month ago
  2. General
  3. # 6
vinnie Accepted Answer
Good evening,I have to reopen the thread, as I noticed something.

With the solution suggested above, if I am logged in, I still see only my photos (file with filefield alias), uploaded on my profile, even when I see other users' profiles. Instead of their photos, I see my own. Is there any way to show only the photo uploaded by the...owner of the profile?

If not, is there any way I can make the profile available only to its user and not to others?

Thanks.
  1. more than a month ago
  2. General
  3. # 7
admin Accepted Answer
Admin
Hi,
yes this is possible, in my previous reply the is a error, please try with something like
<img src="/{user filefield displayed raw}" height="250" />
  1. more than a month ago
  2. General
  3. # 8
vinnie Accepted Answer
Thank you so much, solved.
Have a good day!
  1. more than a month ago
  2. General
  3. # 9
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.