Just wanted to put this inaccuracy out there to fix.
When pulling from the Now API, the height and width given for some images does not correspond with the actual size of the image.
Example:
"images": [{
"height": 90,
"alt": "",
"width": 90,
"name": "Cowherd makes picks for Week 10 in the NFL",
"caption": "Cowherd makes picks for Week 10 in the NFL",
"credit": "",
"url": "http://a.espncdn.com/i/espnradio/stations/espn/shows/300/theherd.jpg"
},
The height is 90 and the width is 90 yet the image is actually 300px (as tipped off by the jpg url).
Seems to be happening with multiple images I've come across, can you please fix?
Thanks!
As of December 7 ESPN has closed their API to the public. Sorry to user2727221 who was looking for a response too. So no update has been made or will be made to API to fix.
Related
I am new in TYPO3, and I am trying something simple, add an image.
Iam doing the following:
I added Content Element "Text & Images"
In the tab "Images" i uploaded an image 1920 x 262
Save
The image loaded is the resolution 600 x 81, i don't understan why.
In the properties i try set 1920 in the field width but same.
In the future i want to know how establish the srcset but first the simple.
(sorry my english)
Sorry to confuse you but there are some rules applied to the maximum size which date back to those days where 600 was already quite large.
the following typoscript constants are relevant:
styles.content {
maxW = 600
maxWInText = 300
}
Depending on the selected value of the field Position and Alignment, one of those 2 applies. So If e.g. "in text, right" is selected, the maximum width is 300.
As a solution you can override the constants to same values which fit more properly.
Most people don't use the default content elements anymore and create custom ones using extensions like mask or dce or without any 3rd party code.
Is there some easy way to scale an image to a maximum size?
Looking for some some easy way to keep file sizes down and scale images that are uploaded from the app to max 640 width for example.
I have googled several solutions, from module Ti.ImageFactory to just put it into an ImageView with a size, and get the blob back again (which should make it scaled?). The Ti.ImageFactory module seems very old though, several years ago updated if you look at GIT. Also the zip files for download seems to be missing on git...
Ex.
Titanium.Media.openPhotoGallery({
success:function(event)
{
Ti.API.info('Our type was: '+event.mediaType);
if(event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO)
{
// HERE event.media needs to be scaled to a max
// size... for example 2 MB data, or max 960 px
// width/height or something similar
uploadPhoto(event.media);
}
},
cancel:function()
{
Ti.API.info("Photo gallery cancel...");
},
error:function(err)
{
//Ti.API.error(err);
Ti.API.info("Err: "+err);
alert(L("AN_ERROR_OCCURRED"));
},
mediaTypes:[Ti.Media.MEDIA_TYPE_PHOTO]
});
What you are looking for is the function imageAsCropped or imageAsResized.
Let me know if you need Further help.
You can use the size property.
size : Dimensionreadonly
The size of the view in system units.
Although property returns a Dimension dictionary, only the width and
height properties are valid. The position properties--x and y--are
always 0.
To find the position and size of the view, use the rect property
instead.
The correct values will only be available when layout is complete. To
determine when layout is complete, add a listener for the postlayout
event.
Documentation Link
I ended up using ti.imagefactory module.
The zip files for android and ios I found here:
https://github.com/appcelerator-modules/ti.imagefactory/releases
Example can be found here:
https://github.com/appcelerator-modules/ti.imagefactory/blob/stable/ios/example/app.js
I used code from the examples in my app and it seems to work fine!
I am trying to create a simple app in pebble.js using the cloud IDE
I have my resources loaded (47 of them) with a colour and a black and white image, with all the correct naming conventions. Here is a snippet from the appinfo.json
{
"file": "images/34_Unlockables.png",
"name": "IMAGES_34_UNLOCKABLES_PNG",
"type": "png"
},
{
"file": "images/45_Leaderboards.png",
"name": "IMAGES_45_LEADERBOARDS_PNG",
"type": "png"
}
When I reference the image by it's name, the app pulls in the wrong image totally. This is the same if I try the url as well
card.banner('images/45_Leaderboards.png');
card.banner('IMAGES_45_LEADERBOARDS_PNG');
both result in the wrong image (and it is always black and white).
Has anyone else hit a similar issue?
Having spend the last couple of days reading the manuals, watching videos and reading through the forum, I can honestly I have no idea what I'm doing.
My basic requirement is to display a video on a web page so that it works in all major browsers.
Easy in Chrome, not so easy in anything else it seems.
For example Firefox will say 'Error loading player, No playable sources available', or if I add more sources it simple prompts me to select a video player on my local machine and proceeds to download the file.
Here is where I'm at right now, of-course it does not work.
jwplayer("playerOMLNJWgiRjbu").setup({
"sources": [
{ "file": "rtmp://video.newnrg.com:1935/vod/mp4:sample.mp4"},
{ "file": "http://video.newnrg.com:1935/vod/mp4:sample.mp4/manifest.mpd" },
{ "file": "http://video.newnrg.com:1935/vod/mp4:sample.mp4/playlist.m3u8"},
{ "file": "http://video.newnrg.com:1935/vod/mp4:sample.mp4/manifest.f4m"},
{ "file": "rtsp://video.newnrg.com:1935/vod/sample.mp4" }
],
"rtmp": {
"bufferlength": 5
},
"primary": "flash",
"modes": [
{ "type": "flash", "src": "/app/src/jwplayer/jwplayer.flash.swf" }
]
});
HTTP tests:
rtmp://video.newnrg.com:1935/vod/mp4:sample.mp4 (200)
http://video.newnrg.com:1935/vod/mp4:sample.mp4/manifest.mpd (200)
http://video.newnrg.com:1935/vod/mp4.../playlist.m3u8 (200)
http://video.newnrg.com:1935/vod/mp4...4/manifest.f4m (200)
rtsp://video.newnrg.com:1935/vod/sample.mp4 (200)
In firefox when rtsp://video.newnrg.com:1935/vod/sample.mp4 is used it asks for a locally installed player to play the video file, yet pasting this URL into the browser address bar works.
I've looked at the wowza homepage to attempt to dissect how this library is being used.
Wowza config:
(on) MPEG-DASH
(on) Apple HLS
(on) Adobe RTMP
(on) Adobe HDS
(on) Microsoft Smooth Streaming
(on) RTSP/RTP
From my perspective I've certainly struggled to get to this point, and have the following questions.
Which is the preferred client side player, with a decent JavaScript API,
I like the JWPlayer api, so can it be used? and what is best practice in easy to follow steps 1, 2, 3.
I retrieve photos from home with this graph API request https://graph.facebook.com/me?fields=home.filter(photos).
Then via the object ID I retrieve the images array that gives me different sizes like this :
"images": [
{
"height": 780,
"width": 1240,
"source": "https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-prn2/281028_10151592859979158_562775226_o.jpg"
},
{
"height": 81,
"width": 130,
"source": "https://fbcdn-photos-g-a.akamaihd.net/hphotos-ak-prn2/s75x225/969715_10151592859979158_562775226_s.jpg"
}
Is it possible to retrieve the originally posted image ?
The image retrieved has to have the same checksum then the image posted
That's no 100% guarantee checksum is same, don't do that. Why? Because if you upload a .gif or .png image, Facebook would do conversion to become a jpeg image instead. So even though you upload a 1920*1280 .png image, what you can get is the modified version 1920*1280 .jpeg image. I have no idea facebook database would keep original image or not, but it's not what you can do using Facebook API.
I don't think you can get the exact, same image by the checksum that you uploaded to their servers. I would think that Facebook modifies them into certain formats so that the photo experience is consistent across the whole site.
That said, they could be keeping a copy of the original photo that was uploaded. But as far as getting access to it via the API or any other way, my best guess is looking at the 'source' according to the Facebook documentation on the Photo object:
The source image of the photo - currently this can have a maximum width or height of 720px, increasing to 960px on 1st March 2012
You can fetch it via the API by:
/<photo id>/?fields=source
Sorry it's not an exact answer, but I hope it helps.