Photo of the Day

Plasma 4 Extensions

Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

6
Become a Fan
6.6

Description:
A plasmoid that displays photo of the day from various websites.
Last changelog:

Version 2.1.1
- Fixed earthshots engine.
- German translation updated ( thanks to Daniel Schemala )
Version 2.1
- Slide show
- www.bonjourmadame.fr provider by Yann Nave(yannux)
- French translation by Yann Nave(yannux)
- German translation by Daniel Schemala

Version 2.0
- Too many changes Requires KDE 4.4

Version 1.2
- Added Wikipedia data engine. Thanks to t3ddy. Only Latin languages are supported due to problems with nonlatin characters in KUrl
- Parsing of National Geographic page is modified to match new design of the web page
- Added possibility for translations.

Version 1.1
- Added smooth transition between photos. They smoothly fade in and fade out and adjust their sizes.
- Added info dialog for data engines
- Added two new data engines: Steve`s digicams and Astronomy Picture of the day

Version 1.0 beta
- Full rework of applet painting
- Now applet uses data engines to receive photos. Applet - data engine communication is through standart Plasma API function, so I think it is possible a data engine to be written in any supported by Plasma language. (If someone is interested, please send me a e-mail or write a comment)
- Error messages are drawn as part of image and disappear in 10 seconds.
- Customizable check for new photo interval.

Version 0.6
- Add smooth transition between photos

Lot of code has been rewritten so please let me know if you detect regressions or bugs.

Version 0.5.2
-Fix all(I hope) compilation problems with KDE 4.2

Version 0.5.1
-Fix compilation on KDE 4.2

Version 0.5
- Added fully configurable photo`s frame, shadow and rounded corners (thanks to Frame plasmoid team)
-Tooltips with information about photo (location, photograph and description)

Version 0.2

-Fixed network detection problems
-Check if photo changed on every one hour
-In case of failure try to load previously saved photo


Ratings & Comments

67 Comments

HardinComp

It looks like either Bonjour Madame or Tumbler itself changed how the pages are coded and now rather than getting the day's BM image it's showing a Facebook icon. I'm trying to track down the proper url for the daily image and if I can come up with a solution I'll see if I can generate the needed change.

Skool182

I've made a little patch for BonjourMadame provider. Copy/pastle into a BonjourMadame.patch on the potd dir, and use patch < BonjourMadame.patch It's possible that it will ask you the file to patch, just enter "providers/BonjourMadame.cpp" and run make / make install on the build directory. Quote:

--- providers/BonjourMadame.cpp 2012-10-15 20:10:40.219368710 +0200 +++ providers/BonjourMadame.cpp 2012-10-15 20:12:51.243372722 +0200 @@ -103,7 +103,7 @@ void BonjourMadame::parseMainPage(QByteArray source) { - int photoTagStart = source.indexOf("<div class=\"photo\">") + (int)strlen("<div class=\"photo\">"); + int photoTagStart = source.indexOf("<div class=\"photo-panel\">") + (int)strlen("<div class=\"photo-panel\">"); int imgStart = source.indexOf("<img src=\"", photoTagStart) + (int)strlen("<img src=\""); int imgEnd = source.indexOf("\"", imgStart); @@ -128,7 +128,7 @@ m_OldUrl = newUrl; // get photographer - int photographerStart = source.indexOf("<div class=\"caption\">") + (int)strlen("<div class=\"caption\">"); + int photographerStart = source.indexOf("<div class=\"copy\">") + (int)strlen("<div class=\"copy\">"); int photographerEnd = source.indexOf("</div>", photographerStart); QString photographer = QString::fromUtf8(source.mid(photographerStart, photographerEnd - photographerStart).trimmed());

HardinComp

I applied the patch then went through the install steps again in the Readme.txt but I still get the Facebook icon instead of the BM image.

HardinComp

I had to to a rebuild since I had dumped the build folder and when I redid the steps I noticed something in the terminal when I try to apply the patch. Here's the entire output in the terminal: $ patch < BonjourMadame.patch can't find file to patch at input line 4 Perhaps you should have used the -p or --strip option? The text leading up to this was: -------------------------- | |--- providers/BonjourMadame.cpp 2012-10-15 20:10:40.219368710 +0200 |+++ providers/BonjourMadame.cpp 2012-10-15 20:12:51.243372722 +0200 -------------------------- File to patch: providers/BonjourMadame.cpp patching file providers/BonjourMadame.cpp patch: **** malformed patch at line 6: void BonjourMadame::parseMainPage(QByteArray source) $

Skool182

Did you use a fresh copy of potd archive ? I know that my patch file is not clean, but I'm not remembering how to make proprely a patch file. I will search the correct method to do that.

HardinComp

It wasn't a fresh extraction of the tarball but the only change to it was to disable the Wikimedia Commons info since that engine's been broken for quite a while. (See above comments about it.)

Skool182

I've just tested this and it worked for me : - download and untar the archive - download the patch : http://skool.blasters.fr/BonjourMadame.patch - goto the v2.1.1 directory - apply patch with "patch -p1 < /path/to/BonjourMadame.patch" - apply the Readme.txt procedure to compile and install Maybe in your case, KDE use the old version of the build. Maybe try a "make uninstall" for removing the old version.

HardinComp

There actually wasn't an older build directory to use. I needed to recreate it to try applying the patch. But it still didn't work, plus I forgot to remove the Wikimedia engine as it's still dead.

HardinComp

Never mind. An idiot unplugged my laptop and when I finally got back on I am able to see the BM image. Thankee!

Skool182

I've just tested this and it worked for me : - download and untar the archive - download the patch : http://skool.blasters.fr/BonjourMadame.patch - goto the v2.1.1 directory - apply patch with "patch -p1 < /path/to/BonjourMadame.patch" - apply the Readme.txt procedure to compile and install Maybe in your case, KDE use the old version of the build. Maybe try a "make uninstall" for removing the old version.

Skool182

damn autorefresh...

oOSplashOo

Thanks for bonjourmadame!!! Great addon^^. Beside could you add the possibility to navigate throught pictures of the same source?

taskstruct

Hello, Yes. I am implementing this functionality. I hope it will be ready in a month :)

aseigo

there is a Picture of the Day DataEngine in kdeplasma-addons. it would be great to see your PotD engines added to it, and then your widget could also use that DataEngine. we could move the DataEngine into kde-workspace so it would be available on all Plasma Desktop/Netbook/Tablet systems. if you're interested in collaborating along these lines, email me! :) aseigo at kde.org

HardinComp

I recently built this from the source code to use on LMDE with KDE bolted onto the top, and I've noticed that whenever the plasmoid tries to display the pic from Wikimedia Commons it keeps the plasmoid from changing off the Bonjour Madame picture. Is there an easy way to fix this or disable using the Wikimidia Commons pictures? My laptop is often in an area where I really don't want the BM image showing up for so long.

taskstruct

Hello, you can remove any of image providers by editing providers/CMakeList.txt There is a section for every provider. Just remove/comment it and rebuild.

HardinComp

Cool, I'll do that. Although I'd rather see it fixed because WikiMedia has some nice daily images.

HardinComp

On second thought never mind the fix request. It seems WikiMedia's site isn't updating for each new day so unless they fix their side this side probably can't be fixed too easily.

MisterSir

None of the photos seem to scale smoothly--they all look horribly jagged. Comparing it to the Flickr photo widget, the difference is harsh. I don't know how Qt works, but I wonder if there's a bug in this code in potd.cpp: // Respect the smooth-scaling setting p->setRenderHint(QPainter::SmoothPixmapTransform, m_smoothScaling); // draw our pixmap into the computed rectangle Qt::TransformationMode trMode = m_smoothScaling ? Qt::SmoothTransformation : Qt::FastTransformation; // get photo QPixmap pm; if ( false == m_bAnimating ) { pm = m_pPhoto->scaled( drawingRect.size().toSize(), Qt::KeepAspectRatio, trMode ); } else { QPixmap from = m_pOldPhoto->scaled( drawingRect.size().toSize(), Qt::IgnoreAspectRatio, Qt::FastTransformation ); QPixmap to = m_pPhoto->scaled( drawingRect.size().toSize(), Qt::IgnoreAspectRatio, Qt::FastTransformation ); pm = Plasma::PaintUtils::transition( from, to, m_transtionOpacity ); } p->drawPixmap(drawingRect.toRect(), pm); p->restore(); p->setRenderHint(QPainter::SmoothPixmapTransform, true);

yannux

:) Warning : it's for kde 4.5.1

yannux

Hey happy to see it released ! Do you know how to make plasmoid package ?

taskstruct

Thanks for Debian package :)

linuxlex

Veri good!!

taskstruct

Phobeus, thanks for the packages :) I`ve updated German translation of source archive. Many thanks to Daniel Schemala, who made translation :)

Phobeus

Packages for F13 64bit-can be found at: http://floriansievert.de/linux/fedora/13/phobos/repoview/kde-plasma-potd.html 32bit will follow after the official release of F13.

Pling
0 Affiliates
Details
license
version 2.1
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 5

More Plasma 4 Extensions from taskstruct:

Photo of the day
taskstruct
last update date: 10 years ago

Score 6.5

Other Plasma 4 Extensions:

Icon Tasks deb build
N00bun2
last update date: 13 years ago

Score 4.3

Prayer Times Plasmoid
riyad
last update date: 13 years ago

Score 5.2

KPrayertime4 Islamic Prayer Times
ahaq
last update date: 15 years ago

Score 4.4

Hostinfo
mgraesslin
last update date: 13 years ago

Score 4.7

Monitor QuadCore Russian
kuchumovn
last update date: 16 years ago

Score 5.0

blaKjaK
werevire
last update date: 15 years ago

Score 5.0