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


Permlink Replies: 9 - Pages: 1 - Last Post: 26-Mar-2017 09:35 Last Post By: Dschuwi
jGromit

Posts: 7,278
Registered: 31-Jan-2006
Detecting "use original"
Posted: 24-Mar-2017 21:42
 
  Click to reply to this thread Reply
In most cases, it's easy to detect that an original image is available. You can check for a non-void originalPath - that takes care of Link to originals via scaled images and the single-image Include original case. You can also check for Link to originals (in that case, originalPath is always void).

But there doesn't seem to be an easy way to detect that the user has selected Link to scaled-down images only, but has tagged one image with Use original. The only way I can think of is to examine the imagePath - if you're building a slide page and it starts with ../, you know it's pointing to an original. If you're building an index page and it doesn't start with slides/, again you know it's pointing to an original.

Is there a more direct way that I'm not thinking about?

In the ordinary course of events,e.g., putting together a slide page, this isn't an issue. It crops up only when you're trying to do something like "provide a download icon only if the image to be downloaded is an original."

(I'm not sure I actually want to differentiate that situation, but....)
RobM

Posts: 3,064
Registered: 4-Aug-2006
Re: Detecting "use original"
Posted: 24-Mar-2017 22:59   in response to: jGromit in response to: jGromit
Helpful
  Click to reply to this thread Reply
What about checking the object's properties for INCLUDE_ORIGINAL?
Would that indicate if an original is available?
jGromit

Posts: 7,278
Registered: 31-Jan-2006
Re: Detecting "use original"
Posted: 24-Mar-2017 23:11   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Good hint (though wrong!). I could do:
currentObject.isUseOriginal()
Now, do I want to detect that, or not....
RobM

Posts: 3,064
Registered: 4-Aug-2006
Re: Detecting "use original"
Posted: 24-Mar-2017 23:19   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
Not sure what the difference is between include and use original (http://jalbum.net/api/se/datadosen/jalbum/AlbumObjectProperties.html), but better than checking the path, I think.
jGromit

Posts: 7,278
Registered: 31-Jan-2006
Re: Detecting "use original"
Posted: 24-Mar-2017 23:26   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
"Include" is, for one image, just like Link to original via scaled image. "Use" is, for one image, just like Link to original.

But yes, better than doing a kludgy path-check!
Dschuwi

Posts: 457
Registered: 12-Nov-2003
Re: Detecting "use original"
Posted: 25-Mar-2017 10:33   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
jGromit wrote:
You can also check for Link to originals (in that case, originalPath is always void).

I wonder why originalPath is void in that case, although in fact an original (hence a path to it) exists.
jGromit

Posts: 7,278
Registered: 31-Jan-2006
Re: Detecting "use original"
Posted: 25-Mar-2017 12:21   in response to: Dschuwi in response to: Dschuwi
 
  Click to reply to this thread Reply
Dschuwi wrote:
jGromit wrote:
You can also check for Link to originals (in that case, originalPath is always void).

I wonder why originalPath is void in that case, although in fact an original (hence a path to it) exists.


I think the logic was that originalPath would be defined only if it pointed to a file other than the one you're seeing on the slide page - in other words, only if it was different from imagePath. For Link to originals and Use original, those two paths would be identical.

But of course for videos, that logic falls apart - originalPath points to the file you're seeing on the slide page. And it's not the original! This has always made me a little crazy.

My gut reaction would be to define originalPath whenever there's an original, even if there's only an original. But maybe that would break something else - I'd have to think about that for a while....
Dschuwi

Posts: 457
Registered: 12-Nov-2003
Re: Detecting "use original"
Posted: 25-Mar-2017 18:16   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
jGromit wrote:
My gut reaction would be to define originalPath whenever there's an original, even if there's only an original. But maybe that would break something else - I'd have to think about that for a while....

I am afraid, since this behaviour has been around for a rather very long time, changing it would almost certainly break something. Whatever was coded relying on where it points under which circumstances, workarounds, dependencies - who knows ... I was only curious about the original intention.
jGromit

Posts: 7,278
Registered: 31-Jan-2006
Re: Detecting "use original"
Posted: 25-Mar-2017 20:11   in response to: Dschuwi in response to: Dschuwi
 
  Click to reply to this thread Reply
Dschuwi wrote:
I am afraid, since this behaviour has been around for a rather very long time, changing it would almost certainly break something.

I have exactly the same feeling, but can't quite put my finger on why.

When it comes to the weird situation with videos, I wish David had straightened this out a long time ago. The longer it remains the way it is, the worse it's going to be to fix it. As it stands, there's no way to include both a processed video and its original version (which might, for example, be much higher resolution) in a single album, as you can with images.
Dschuwi

Posts: 457
Registered: 12-Nov-2003
Re: Detecting "use original"
Posted: 26-Mar-2017 09:35   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
jGromit wrote:
I wish David had straightened this out a long time ago. The longer it remains the way it is, the worse it's going to be to fix it. As it stands, there's no way to include both a processed video and its original version

You are right, and it turned delicate (irreversably IMHO) with video support.

A similar situation came up with "Hi-Res" images, where originalPath would suddenly point to a not so original downscaled and processed image ...

While all this was certainly done for legit reasons, I suggested quite a while ago to introduce an additional variable like trueOriginalPath - this would not break anything, but whoever stumbled over the meanwhile well-known inconsistencies, could easily adapt their skin if required.
Legend
Forum admins
Helpful Answer
Correct Answer

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