Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set "Imagemap message" image files? #34

Closed
synr opened this issue Dec 22, 2016 · 19 comments
Closed

How to set "Imagemap message" image files? #34

synr opened this issue Dec 22, 2016 · 19 comments

Comments

@synr
Copy link

synr commented Dec 22, 2016

Hello! I read "https://github.com/line/line-bot-sdk-go/blob/master/examples/kitchensink/server.go"
has

			linebot.NewImagemapMessage(
				app.appBaseURL+"/static/rich",
				"Imagemap alt text",
				linebot.ImagemapBaseSize{1040, 1040},
				linebot.NewURIImagemapAction("https://store.line.me/family/manga/en", linebot.ImagemapArea{0, 0, 520, 520}),
				linebot.NewURIImagemapAction("https://store.line.me/family/music/en", linebot.ImagemapArea{520, 0, 520, 520}),
				linebot.NewURIImagemapAction("https://store.line.me/family/play/en", linebot.ImagemapArea{0, 520, 520, 520}),
				linebot.NewMessageImagemapAction("URANAI!", linebot.ImagemapArea{520, 520, 520, 520}),
			),

I know app.appBaseURL+"/static/rich" is JPG or PNG file path.
But how can I use ? filename set index.jpg in app.appBaseURL+"/static/rich" path???
or any file name?
or app.appBaseURL+"/static/rich/xxx" (xxx is int)
or ?????

@sugyan
Copy link
Contributor

sugyan commented Dec 22, 2016

Details about baseURL are written in the document, so please read it.
https://devdocs.line.me/en/#base-url

@synr
Copy link
Author

synr commented Dec 24, 2016

I read that.
But I still don't know.
What picture filename set ???

https://example.com/images/cats
https://example.com/images/cats/700

Any filename is ok?

https://example.com/images/cats/123456789.jpg
https://example.com/images/cats/700/123456789.jpg

@mokejp
Copy link
Member

mokejp commented Dec 26, 2016

@synr
I guess you think 700 is a directory name.
1040, 700, 460, 300 and 240 are filenames, not directory names.
So, you should place images that named 1040, 700 and etc. without extension.

This is example.

@synr
Copy link
Author

synr commented Dec 27, 2016

@mokejp
Thank you!!
I try it and success!

@synr synr closed this as completed Dec 27, 2016
@uopeydel
Copy link

hey guy i dont understand it to but when i read all comment in this page it still not understand.
please explain me to use image map a little..

https://example.com/images/cats/700.jpg

ex. if i habe image same this how can i do? in image map json? i paste url with no .jpg? or i will rename it remove .jpg? or else?
i can set baseUrl = "https://example.com/images/cats/700"
and linkUri ="https://www.google.co.th/"
or other thing?

@sugyan
Copy link
Contributor

sugyan commented Jan 16, 2017

@uopeydel If you have image file named 700.jpg and supply as static file, you should copy and resize it and deploy each size.
700.jpg ➡️ (resize to 240x240) ➡️ https://example.com/images/cats/240 (no extension)
700.jpg ➡️ (resize to 300x300) ➡️ https://example.com/images/cats/300 (no extension)
700.jpg ➡️ (resize to 460x460) ➡️ https://example.com/images/cats/460 (no extension)
700.jpg ➡️ (rename) ➡️ https://example.com/images/cats/700 (no extension)
700.jpg ➡️ (resize to 1040x1040) ➡️ https://example.com/images/cats/1040 (no extension)

and you specify baseUrl as https://example.com/images/cats, it will work well.

@uopeydel
Copy link

uopeydel commented Jan 16, 2017

@sugyan
Copy link
Contributor

sugyan commented Jan 16, 2017

@uopeydel
When you specified baseUrl as https://dev-chat.on.lk/Content/image/show, LINE client will get image of following URLs

so please deploy each size images for them.

Since linkUri is for actions, it does not matter.

@sugyan
Copy link
Contributor

sugyan commented Jan 16, 2017

@uopeydel
Copy link

https://dev-chat.on.lk/Content/image/show/700.jpg << but this link can do image ?

@sugyan
Copy link
Contributor

sugyan commented Jan 16, 2017

@uopeydel
No. No. URL is https://dev-chat.on.lk/Content/image/show/700. There is no extension like ".jpg".

Files of example app https://github.com/line/line-bot-sdk-go/tree/master/examples/kitchensink/static/rich have no extensions, but static server returns image content. You must supply image in https://dev-chat.on.lk/Content/image/show/700, not https://dev-chat.on.lk/Content/image/show/700.jpg.

@highmusahi
Copy link

"type": "imagemap", "baseUrl":"http://res.cloudinary.com/dazmnrals/image/upload/v1498200198/honda_car/brio/240",
"altText": "this is an imagemap",
"baseSize": {
"height": 240,
"width": 240
},
"actions": [
{
"type": "uri",
"linkUri": "http://res.cloudinary.com",
"area": {
"x": 0,
"y": 0,
"width": 240,
"height": 240
}
}
i try this but it doesn't work at all
doc: https://devdocs.line.me/en/#imagemap-message

@jaajaah
Copy link

jaajaah commented Jul 3, 2017

@sugyan
thanks when i upload 5 file size and i can do it success,
but i want to upload image 1 file only ,Can i do ?

@StefanMao
Copy link

StefanMao commented Jul 3, 2017 via email

@StefanMao
Copy link

StefanMao commented Jul 3, 2017 via email

@jaajaah
Copy link

jaajaah commented Jul 3, 2017

@StefanMao
thanks ,, I tested upload 5 files (different size) it's work.
But I want to upload just 1 file
such as URL https://xxx/image/001/
directory for upload ..//image/001/

What should I do ? Can you suggest me please ?

@IT5706021631069
Copy link

@jaajaah
Can you show your code about image map?
Thanks.

@IT5706021631069
Copy link

i upload 5 size images on github(https://github.com/IT5706021631069/imagemap_line/tree/master/rich/)
but it show Unable to load image.

@jaajaah
Copy link

jaajaah commented Aug 4, 2017

@IT5706021631069
{
"type": "imagemap",
"baseUrl": "https://example.com/images/pic001",
"altText": "this is an imagemap",
"baseSize": {
"height": 1040,
"width": 1040
},
"actions": [
{
"type": "uri",
"linkUri": "https://example.com/",
"area": {
"x": 0,
"y": 0,
"width": 520,
"height": 1040
}
}
]
}

//***************************************
directory for upload 5 file no extensions
..//images/pic001/240
..//images/pic001/300
..//images/pic001/460
..//images/pic001/700
..//images/pic001/1040

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants