Displaying vCard photos in Windows Contacts - windows

Following vCard 2.1, I'm adding photos to vCards. I'm encoding the image fetched from a URL, then adding the encoded value to the proper place within the vCard. This seemingly displays the photo correctly for all programs that can open vCards except the Windows Contacts program on Windows 7 (probably doesn't work for newer versions of Windows either).
As far as I can tell, the below snippet should display the vcard photo when opened in Windows Contacts:
BEGIN:VCARD
VERSION:2.1
N;CHARSET=ISO-8859-1:Lastname;Firstname;
FN;CHARSET=ISO-8859-1:Firstname Lastname
ORG;CHARSET=ISO-8859-1: Organization LLP
PHOTO;ENCODING=b;TYPE=jpg: <base64 encoded image as one line>
TITLE;CHARSET=ISO-8859-1:Position
TEL;WORK;VOICE:+1 999 999 9999
END:VCARD
All the other information displays in Windows Contacts, but not the photo. The standard blank image placeholder displays.
I have tried
ENCODING=BASE64
ommitting the ENCODING keyword altogether
removing the TYPE keyword altogether
using specifically a 240px by 240px image
adding the image URL value in the file instead of the encoded value
Anyone have any ideas?

Version 2.1 uses ENCODING=BASE64.
Put an empty line after the PHOTO property. Outlook requires this, so Contacts might too.
Put all parameter names/values in upper case. I know of one compatibility problem with Windows Contacts where it doesn't recognize a parameter value if it's in lower case.
Remove the space character before the base64 data.
Try setting the TYPE parameter to JPEG.
You've correctly encoded the image data, right? Try using an online decoder to make sure.
Corrected property:
PHOTO;ENCODING=BASE64;TYPE=JPEG:<base64 encoded image as one line>
[empty line]
According to the specs, if you have a URL, you should set the VALUE parameter to URL.
PHOTO;TYPE=JPEG;VALUE=URL:<url goes here>

I've run into your post while researching this question and I was able to successfully find the correct way to achieve this.
Bellow is a self-containing example of a v-card containing an 96x96 embedded red.gif image as the PHOTO.
https://www.rfc-editor.org/rfc/rfc2426#section-3.1.4
Be sure to note the VERSION line and the PHOTO line. This is currently working in Outlook365.
BEGIN:VCARD
VERSION:3.0
N:Gump;Forrest;;Mr.;
FN:Forrest Gump
ORG:Bubba Gump Shrimp Co.
TITLE:Shrimp Man
PHOTO;ENCODING=BASE64;TYPE=GIF:R0lGODdhYABgAPAAALccHMlFJiH5BAEAAAEALAAAAABgAGAAAAJuhI+py+0Po5y02ouz3rz7D4biSJbmiabqyrbuC8fyTNf2jef6zvf+DwwKh8Si8YhMKpfMpvMJjUqn1Kr1is1qt9yu9wsOi8fksvmMTqvX7Lb7DY/L5/S6/Y7P6/f8vv8PGCg4SFhoeIiYqLiIUgAAOw==
TEL;TYPE=work,voice;VALUE=uri:tel:+1-111-555-1212
TEL;TYPE=home,voice;VALUE=uri:tel:+1-404-555-1212
ADR;TYPE=WORK;PREF=1;LABEL="100 Waters Edge\nBaytown\, LA 30314\nUnited States of America":;;100 Waters Edge;Baytown;LA;30314;United States of America
ADR;TYPE=HOME;LABEL="42 Plantation St.\nBaytown\, LA 30314\nUnited States of America":;;42 Plantation St.;Baytown;LA;30314;United States of America
EMAIL:forrestgump#example.com
REV:20080424T195243Z
x-qq:21588891
END:VCARD

Related

Send an image link to telegram without display image url

I need send an image url to telegram without display image url and hidden url. I see a telegram bot and it's do it very well and send long message with image I'm attach this bot result image see it.
Now how can do it in my custom bot? It's possible hidden url with MARKDOWN style or any way? I want hidden image url in my text but telegram display my image. see my sample attach image.
thank you
Most of them use the dot (or some things like this character) for link description and you thought there is no link.
You can type the following line and select custom markdown:
#bold [.](http://www.planwallpaper.com/static/images/i-should-buy-a-boat.jpg)
If you want to add text to your link, you need to create a bot and use this approach in the bot.
Edit:
For sending hyperlink with the bot api you can simply send html markup and using parse_mode. See telegram documents:
To use this mode, pass HTML in the parse_mode field when using sendMessage. The following tags are currently supported:
<b>bold</b>, <strong>bold</strong>
<i>italic</i>, <em>italic</em>
inline URL
inline mention of a user
<code>inline fixed-width code</code>
<pre>pre-formatted fixed-width code block</pre>
sample:
According to the Telegram API, it seems if you set disable_web_page_preview to true, you should get the result you want.
The final message should look something like this:
{
chat_id: 1235,
message: "http://your/url",
disable_web_page_preview: true,
}
EDIT:
It seems I misunderstood the question, and you actually want the image to appear by itself rather than the url by itself.
Again, as per the Telegram API you can send an image directly. But as far as I can tell, you can't use a URL to do it. You would have to upload the photo from your telegram server directly. You could use the caption property to send text with it.
Here is an example of how you might be able do this in python. You will need to tweak this to whichever language you are using, but the concept is the same.
import requests
response = requests.post(
"https://your.bot.url.com/sendPhoto",
data={
"chat_id": 1234,
"caption": "Your extra text here"
}
files={
"photo": (
"image_name.jpg",
"contents of image",
"image/jpg",
{},
)
}
)
The caption property has a limit of 200 characters, so if you want to send more characters then that, you'll have to send two messages.
You can always ask Telegram to add this type of functionality in the future
The answer is zero-width non-joiner (ZWNJ) character. ZWNJ is encoded in Unicode as U+200C ZERO WIDTH NON-JOINER (HTML ‌ , ‌).
HTML mode:
‌
MARKDOWN mode:
[‌‌](https://example.com)
Update 2021:
The answer is still working but telegram doesn't let you send an empty text message that include only this character anymore, so you have to add at least one character in the whole text message. In addition you can also use the character Unicode Character 'WORD JOINER' (U+2060) instead.
You can use   character as hidden character.
This might help:
It works for both:
web links
telegram links
import requests
def telegram(channel,bot,text,img):
if(text==""):text="Refer - "
r = requests.get('https://api.telegram.org/bot'+bot+'/sendMessage?chat_id=#'+channel+'&parse_mode=markdown&text='+"[​​​​​​​​​​​]("+img+")"+text)
Use the above function. It will work perfectly. In case, there is no text and only image, it should break. So it will show a "." (dot) in those cases.
Now use the function -
telegram(your_channel_name,your_token_here,description,image_url)
To correctly send an image hosted on a website without showing any reference link, you must use the "html" parsing mode.
And in the content to send, for example, something like this (Python mode):
# We take the html address of the image.
image_address = 'https://picsum.photos/100.jpg'
# The unicode character to prevent the words from
# being separated, in this case, we take advantage
# of it so that the Telegram API accepts it and
# incidentally so that it does not take up space
# when including text in the message.
word_joiner = '&#8288'
# This would be the final pattern.
html_pattern = f'{word_joiner}'
With HTML parse mode. Keep empty space between the opening and closing tag.

How to render Latin 1 characters correctly using coldfusion 11 and pdf document

I am having trouble getting the latin character ä to display correctly in a pdf generated from ColdFusion code. I get ä instead of ä. I am setting cfprocessing directive to UTF-8. I can hardcode &auml and get the ä character displaying correctly in the pdf. So the pdf can handle displaying the character.
Most posts refer to a mismatch of encoding that is causing this mojibake, but I can't see where there is any mismatch. The value being used as input into the pdf document is coming from a form (ColdFusion) that takes user input and the form tag in CF code has this property set:
accept-charset="utf-8"
On the input form, and in the cfm file handling the submit, the processing directive is set to UTF-8. Does anyone have any suggestions?
I did end up solving my issue. It was obviously an encoding mismatch and because the user entered data is passed to another cfm page via javascript logic I was guessing that I was getting a one-byte character represention...which cannot display latin-1...so i played around with the CharsetDecode and CharsetEncode methods. I decoded the user string using windows-1252 and then encoded it using utf-8, and voila..no more issues. Not real happy with my solution, but after a couple of days of playing with it i was happy to "beat" it finally.

Display Access data with image paths in Word document

I would like to make a Word product catalog from data stored in an Access 2007 database. I can of course use the "mail merge" function in Word for the text data, but I dont know how to make the images show up! They are they stored as file paths in Access and jpg-files in a directory on the hard drive. The images should have a special size, be right aligned to the text paragraphs so that the text is wrapping on the left side (see attached image).
This is possible, but works better in older versions of Word. Unfortunately, you don't mention which version you're using...
Anyway, the key to the question is to use an IncludePicture field to bring the picture in; pass the file path to the field using the MergeField (nested fields). You can find more information on the internet, for example: http://homepage.swissonline.ch/cindymeister/mergfaq1.htm#DBPic
The problem with an IncludePicture field is that it can't be wrapped. But if your version of Word is not too old, tables CAN wrap, so you put the IncludePicture field into a table that's a single cell. Position the table, wrap it, etc.

Joomla 2.5 with Sobi Pro and Mandarin characters

My client has a single page on his Joomla! 2.5 site whose content must be translated into Mandarin. In text areas within Sobi Pro, we can easily add the Mandarin text, and all is fine, but in text fields, we are unable to add the text - we get a bright red validation error with the text "The data entered in the "area name" field contains not allowed characters".
How can I make it work so that I can enter Chinese characters in these text fields?
Thanks!
Kobus
Found out by means of a person on the Sobi Pro website; it was a filter that prevented input of the characters. Problem is solved.
Thanks!
Kobus

Drupal 7 - 'Text on Image' Conversion

How can we convert the contents of the article into image/pdf format in drupal 7.
Suppose, we are viewing a article in some textformat (ie default format of drupal) and if we want to see the contents of article on a image format.
I'm dealing with content that is some value and can't be openly published without any security. Though i know its baseless to restrict others from copying the content, but still i like doing my own piece of work to stop content copying.
you can also use a module Cufon for text1 to image conversion

Resources