This question is not answered. Helpful answers available: 1. Correct answers available: 1.


Permlink Replies: 14 - Pages: 1 - Last Post: 18 Feb 21, 19:06 Last Post By: AndreWolff Threads: [ Previous | Next ]
AndreWolff

Posts: 2,357
Registered: 14-Dec-2007
Bug: Can't use a pdf-file as weblocation
Posted: 10 Feb 21, 10:13
 
  Click to reply to this thread Reply
If I add a pdf file as web location and I click on the update button, I get a crash:
org.jsoup.UnsupportedMimeTypeException: Unhandled content type. Must be text/*, application/xml, or application/xhtml+xml. Mimetype=application/pdf, URL=https://andrewolff.jalbum.net/VechtSaharaN_FB/routebeschrijving-den-haag.pdf
	at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:689)
	at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:628)
	at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:260)
	at org.jsoup.helper.HttpConnection.get(HttpConnection.java:249)
	at org.jsoup.Jsoup.parse(Jsoup.java:183)
	at se.datadosen.jalbum.WebLocation.findRepresentingImage(WebLocation.java:332)
	at se.datadosen.jalbum.JWebLocationEditPanel$1$1.doInBackground(JWebLocationEditPanel.java:78)
	at se.datadosen.jalbum.JWebLocationEditPanel$1$1.doInBackground(JWebLocationEditPanel.java:63)
	at java.desktop/javax.swing.SwingWorker$1.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.desktop/javax.swing.SwingWorker.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

The used pdf-file https://andrewolff.jalbum.net/VechtSaharaN_FB/routebeschrijving-den-haag.pdf exists,
This was OK in the past.
It works too correctly with html files.

System Windows 10 and jAlbum 22.1.3

Edit:

This is a bug, so it should be moved to the Bug reports thread.

Edited by: AndreWolff on 12-Feb-2021 10:43
hanso

Posts: 111
Registered: 16-Apr-2008
Re: Bug: Can't use a pdf-file as weblocation
Posted: 14 Feb 21, 12:52   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
Your PDF works as web location without problems in a Tiger test album. (Edge, Windows 10, jalbum 23.1).

Not a current Jalbum bug it seems (your version is not the current?).

What skin do you use?
AndreWolff

Posts: 2,357
Registered: 14-Dec-2007
Re: Bug: Can't use a pdf-file as weblocation
Posted: 14 Feb 21, 13:46   in response to: hanso in response to: hanso
 
  Click to reply to this thread Reply
hanso wrote:
Not a current Jalbum bug it seems (your version is not the current?).
I use jAlbum 23.2 on a Windows 10 sytem
What skin do you use?
FancyBox, but it has nothing to do with the skin, I see it also with the Minimal skin en in a new project with the Tiger skin.
hanso

Posts: 111
Registered: 16-Apr-2008
Re: Bug: Can't use a pdf-file as weblocation
Posted: 14 Feb 21, 14:13   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
In your report dated 12 february you mentioned an older version of Jalbum, 22.1.3 and just now 23.2.

That is why I asked about the version.
JeffTucker

Posts: 8,240
Registered: 31-Jan-2006
Re: Bug: Can't use a pdf-file as weblocation
Posted: 14 Feb 21, 14:17   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
A web location should be a web page. A PDF is not a web page - it's just a file.

It does work, as long as you stay away from the Update buttons. Choose New page... web location, and enter a URL, like https://jefftucker.jalbum.net/frenchpress.pdf. But then do not click Update - that's what tells the jAlbum core to visit the web page and try to extract a representing image from it. It won't work, because the PDF is not a web page - there are no images there. Just move down to the Image URL field and choose an image to represent the page. Again, lay off the Update button. Just click OK, and make your album.

ETA: The expected way of showing a PDF in an album is to add the PDF as a regular album object, and then let the skin display it in the album. There should be no need to try to torture the web location routine into handling it.
ctwist

Posts: 717
Registered: 27-Sep-2003
Re: Bug: Can't use a pdf-file as weblocation
Posted: 14 Feb 21, 14:41   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
If the PDF file is available locally, yes it should be added as a regular album object.

If it is on a remote web site, it needs to be a web location.
JeffTucker

Posts: 8,240
Registered: 31-Jan-2006
Re: Bug: Can't use a pdf-file as weblocation
Posted: 14 Feb 21, 14:46   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
If it's on a remote website, you need to download it, then add it to your project.

If a JPG or MP4 is available on a remote site, should you be able to add it as a web location?
ctwist

Posts: 717
Registered: 27-Sep-2003
Re: Bug: Can't use a pdf-file as weblocation
Posted: 14 Feb 21, 14:49   in response to: JeffTucker in response to: JeffTucker
Helpful
  Click to reply to this thread Reply
A PDF file may be dynamic, in which case you want to show the latest version.
RobM

Posts: 4,233
Registered: 4-Aug-2006
Re: Bug: Can't use a pdf-file as weblocation
Posted: 14 Feb 21, 14:56   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
If it's on a remote website, you need to download it, then add it to your project.

If a JPG or MP4 is available on a remote site, should you be able to add it as a web location?

If it is on someone else’s website it shouldn’t be made to appear on your own, at least without permission. The linked file in the first post includes the statement ‘ No part of this publication may be reproduced and / or made public by means of print, photocopy, publication on the internet or in any other way, without the prior written permission of Wandelnet.’ I trust that such permission has been given and is available for jAlbum, should they ask for it, to ensure the content is ok.
JeffTucker

Posts: 8,240
Registered: 31-Jan-2006
Re: Bug: Can't use a pdf-file as weblocation
Posted: 14 Feb 21, 14:59   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
ctwist wrote:
A PDF file may be dynamic, in which case you want to show the latest version.

Well, as I've explained, you can do that if you really want to. There is no actual problem here. Can we perhaps not beat the damn thing to death?
AndreWolff

Posts: 2,357
Registered: 14-Dec-2007
Re: Bug: Can't use a pdf-file as weblocation
Posted: 14 Feb 21, 17:54   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
It does work, as long as you stay away from the Update buttons. Choose New page... web location, and enter a URL, like https://jefftucker.jalbum.net/frenchpress.pdf. But then do not click Update - that's what tells the jAlbum core to visit the web page and try to extract a representing image from it. It won't work, because the PDF is not a web page - there are no images there. Just move down to the Image URL field and choose an image to represent the page. Again, lay off the Update button. Just click OK, and make your album.
Indeed if I don't click the Update button, it works.

But I think it would be nice if jAlbum suppresses the crash in case a PDF-file or image is selected as weblocation!
AndreWolff

Posts: 2,357
Registered: 14-Dec-2007
Re: Bug: Can't use a pdf-file as weblocation
Posted: 14 Feb 21, 17:57   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
ctwist wrote:
A PDF file may be dynamic, in which case you want to show the latest version.
Exactly and why should you duplicate a file / web-page which is already available on the Internet?
ctwist

Posts: 717
Registered: 27-Sep-2003
Re: Bug: Can't use a pdf-file as weblocation
Posted: 14 Feb 21, 18:05   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
AndreWolff wrote:
But I think it would be nice if jAlbum suppresses the crash in case a PDF-file is selected as weblocation!
It would be better to disable the update button if the file type is not supported as a web location.
AndreWolff

Posts: 2,357
Registered: 14-Dec-2007
Re: Bug: Can't use a pdf-file as weblocation
Posted: 14 Feb 21, 18:12   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
ctwist wrote:
It would be better to disable the update button if the file type is not supported as a web location.
Yes that is a better solution!
AndreWolff

Posts: 2,357
Registered: 14-Dec-2007
Re: Bug: Can't use a pdf-file as weblocation
Posted: 18 Feb 21, 19:06   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
ctwist wrote:
A PDF file may be dynamic, in which case you want to show the latest version.
You see that effect in the FancyBox sample album, click on the thumbnails 7 and 8 to see the difference.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums