My Opera Development

Behind the scenes at My Opera

Subscribe to RSS feed

Posts tagged with "albums"

New option for sorting your photos

, , ,

We released an update for photo sorting today, and I'd like to take a moment to tell about them.

Previously you could go to an album's "Edit album" page where you'd find the "Sort photos" tab. Here you could automatically arrange album photos by "Date" or "Name" in ascending or descending order, but it wasn't very clear what date we were referring to: the upload date or the date the photos were taken.

This is why we've now changed the "Date" to "Upload date"; rearranging photos by date has always referred to the date the pictures were uploaded, not the date the pictures were taken. And since you're able to freely rearrange photos on that page, we've also renamed the whole page to "Rearrange photos".

But wait, there's more! wizard

If you want to show photos in an album ordered by what date the various photos were taken there's now an option for that on the "Album details" page. The "Sort photos by" dropdown gives you three options:
  • My order
  • Date photo taken
  • Date photo uploaded
Selecting "My order" sorts the photos by whatever order you set in the "Rearrange photos page".

Selecting "Date photo taken" sorts the photos by the dates the photos were taken, with the most recent last. Note that this will only work if the photo is uploaded with the "generated" time in it's metadata. If it's missing we go back to ordering by upload date.

Selecting "Date photo uploaded" sorts the photos by the dates the photos were uploaded, with the most recent last.

We hope you find this useful, and as always you can report bugs in the the My Opera forums.

10 million pictures!

, , ,

On September 21st, we finally reached 10 million pictures in our database!
Congratulations to all our users! Keep going!

Embedding My Opera content (OEmbed)

, , ,

Now you can embed photos and other My Opera content like avatars from external sites. It's been on our roadmap for some time.

We chose to embrace the OEmbed (www.oembed.com) "specification" for doing that.

OEmbed it's really simple. It uses JSON (or XML) as an interchange format, and the request and response types are really simple and straightforward. An OEmbed request has the following structure:

http://my.opera.com/service/oembed?url=<some_url>&format=json

The format is json by default and can be omitted, so a sample request to get information about MyOpera photo album looks like:

http://my.opera.com/service/oembed/?url=http%3A%2F%2Fmy.opera.com%2Fcstrep%2Falbums%2Fshow.dml?id%3D504322

This is one of my photo albums. The result is the following:

{
  "author_name" : "cstrep",
  "provider" : "My Opera Community",
  "images" : {
      "image" : [
        "http://my.opera.com/cstrep/albums/showpic.dml?album=504322&picture=6964560",
        "http://my.opera.com/cstrep/albums/showpic.dml?album=504322&picture=6964559",
        "http://my.opera.com/cstrep/albums/showpic.dml?album=504322&picture=6964556",
        "http://my.opera.com/cstrep/albums/showpic.dml?album=504322&picture=6964558",
        "http://my.opera.com/cstrep/albums/showpic.dml?album=504322&picture=6964531",
        "http://my.opera.com/cstrep/albums/showpic.dml?album=504322&picture=6964554",
        "http://my.opera.com/cstrep/albums/showpic.dml?album=504322&picture=6964557",
        "http://my.opera.com/cstrep/albums/showpic.dml?album=504322&picture=6964555"
      ]
  },
  "author_url" : "http://my.opera.com/cstrep/",
  "provider_url" : "http://my.opera.com/",
  "version" : "1.0",
  "type" : "link",
  "title" : "Italian Day"
}

Note: if you have problems displaying the JSON code and you're faced with a download instead, try to instruct your browser to open application/json mimetype directly. In Opera, just go to the Tools menu, Preferences. Click on the Advanced tab, then Downloads on the left. You can see all the special mimetypes. Now click on Add, and insert the application/json mimetype and tell Opera to open it directly.

You can also recursively request information about a single picture, using:

http://my.opera.com/service/oembed?url=http%3A%2F%2Fmy.opera.com%2Fcstrep%2Falbums%2Fshowpic.dml%3Falbum%3D504322%26picture%3D6964560

The result is:

{
  "width" : "2080",
  "author_name" : "cstrep",
  "provider" : "My Opera Community",
  "author_url" : "http://my.opera.com/cstrep/",
  "provider_url" : "http://my.opera.com/",
  "version" : "1.0",
  "height" : "1544",
  "url" : "http://files.myopera.com/cstrep/albums/504322/100_2450.jpg",
  "title" : "Giardinelli Beach. Sardinia.",
  "type" : "photo"
}

So, there you have it, the filename of the picture, finally...

The base implementation for this OEmbed functionality is completely generic and open. Then we have a bunch of different plugins, like Photo, Avatar, Album, and so on... And it's really easy to add new ones.

We're now planning to use this API internally for new features already planned. Hopefully also widgets.opera.com will use OEmbed internally to access avatar pictures. Here's an example:

http://my.opera.com/service/oembed?url=http%3A%2F%2Fmy.opera.com%2Fcstrep%2Favatar.pl

If you prefer the xml format instead, you can append the format=xml argument to the URL, like in the following example:

http://my.opera.com/service/oembed?format=xml&url=http%3A%2F%2Fmy.opera.com%2Fcstrep%2Favatar.pl

Of course, not everything is accessible to any user. Private albums will remain private. Anyway, the main point of OEmbed is being able to share content, so... have fun.