rometools/rome

Image Url returns Pictures in Low Quality

Closed this issue · 3 comments

Hi there, this is only indirectly related to the library, however, I thought I still ask for your advice.
I am using Rome to fetch numerous RSS Feeds, save article Information in a Database, and then expose this Information via a REST API which is consumed by a mobile application.
The Problem I am currently Facing is that the img_url of Articles provide sometimes Pictures of low quality and I don't know how to overcome this. Especially the magazine Bild gives me a headache that returns pictures in low quality if you don't specify a resolution in the URL query parameters, but also other RSS Feeds provide sometimes pictures in low quality.
Bildschirmfoto 2022-04-23 um 08 39 04
Have you experienced similar issues and/or do you have any ideas, recommendation how to solve this?
Thanks a lot in advance!

Hi, @lukonjun!

I got an Bild.de RSS sample (link). In this case, RSS092Parser get the 'description' node at each item, that contains an thumbnail image.

Reviewing the feed, ROME parses it with the Yahoo! MediaRSS module plugin included in rome-modules project. With this approach, the SyndFeed contains a MediaEntryModule reference that contains the image as you need:

for (SyndEntry syndEntry : feed.getEntries()) {
  MediaEntryModule mm = (MediaEntryModule) syndEntry.getModule(MediaModule.URI);
  LOG.info("{}", mm.getMediaContents()[0].getReference());
}

Regards!

Hi @antoniosanct, thanks a lot for your answer!

For some reason, I am not able to import the MediaEntryModule Class. I checked my pom.xml

<dependency>
	<groupId>com.rometools</groupId>
	<artifactId>rome</artifactId>
	<version>1.18.0</version>
</dependency>

And also verified the included jars
Bildschirmfoto 2022-04-30 um 09 26 15
Might be missing a silly point but could you maybe share your pom.xml, this import is not working for me import com.rometools.modules.mediarss.MediaEntryModule;

Besides that, if this would solve my problem with the low-resolution pictures it would be super great!

@lukonjun You have to add the rome-modules dependency to use the MediaRSS module :)