Coder Social home page Coder Social logo

Comments (11)

sebastian-meyer avatar sebastian-meyer commented on June 23, 2024 4

I am currently working on simplifying the 3D support and in turn reverting the changes regarding the internal proxy. It will take a few more weeks due to vacations, but this should fix this issue.

from kitodo-presentation.

sebastian-meyer avatar sebastian-meyer commented on June 23, 2024 1

The problem seems to be the following:

  1. Commit 2578e7a introduced a change to setup.typoscript enabling the use of the internal image proxy by default.
  2. The image proxy uses the eID script PageViewProxy.php to access external files, which is registered in ext_localconf.php.
  3. BUT: Registration of the eID script only happens when the extension configuration option enableInternalProxy is set in ext_conf_template.txt, which it is not by default.

So we have a mismatch of default configuration requiring the use of the internal proxy in the PageView plugin, but not enabling it in the first place. I suggest reverting the change to setup.typoscript and thus restoring the old behavior. Furthermore the image proxy should only be used if necessary anyway while the default should be to rely on CORS headers.

What do you think, @csidirop and @beatrycze-volk?

from kitodo-presentation.

beatrycze-volk avatar beatrycze-volk commented on June 23, 2024 1

But I am not sure if I understand the meaning of plugin.tx_dlf.settings.useInternalProxy correctly. Maybe it's just a duplicate of enableInternalProxy and we should get rid of it?

I think we got here to some deeper misunderstanding. useInternalProxy is not newly introduced. In general, we have already in code useInternalProxy (PageView.xml) e.g.

<settings.useInternalProxy>
    <TCEforms>
         <exclude>1</exclude>
           <label>LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.pageview.flexform.useInternalProxy</label>
           <config>
                  <type>check</type>
                 <default>0</default>
           </config>
       </TCEforms>
 </settings.useInternalProxy>

Also in places in which we are using proxy we are querying for $this->settings['useInternalProxy']. My idea by introducing it to the typo setup was to avoid double setting it in the both of plugins. (I didn't yet remove this setting from those plugins FlexForms). While I was doing it, I have missed existence of enableInternalProxy. I see now, that enableInternalProxy is used for activating eID script as @sebastian-meyer has mentioned.

We need to definitely consolidate those two settings into one. For now probably reversing of adding it to the global typo setup should solve the problem.

from kitodo-presentation.

csidirop avatar csidirop commented on June 23, 2024

An other way to reproduce this, is to use our docker images:

  1. Clone repo: git clone https://github.com/UB-Mannheim/kitodo-presentation-docker
  2. Change dir: cd kitodo-presentation-docker
  3. Change branch: git checkout dfg-viewer-dev
  4. Start docker container: docker compose up
  5. Wait till everything is up
  6. (you may need to re-save the page configuration: BE -> Site Management -> Site: edit and save)
  7. open: localhost and use any of the examples or use your own METS file, e.g.: http://localhost/viewer?tx_dlf[id]=https%3A%2F%2Fdigi.bib.uni-mannheim.de%2Ffileadmin%2Fvl%2Fubmaosi%2F59088%2F59088.xml

from kitodo-presentation.

beatrycze-volk avatar beatrycze-volk commented on June 23, 2024

If after that proxy for 3D models works, than I'm fine with your solution :)

from kitodo-presentation.

sebastian-meyer avatar sebastian-meyer commented on June 23, 2024

If after that proxy for 3D models works, than I'm fine with your solution :)

We would have to rework this a little bit: Currently there are two different configuration options effectively meaning the same thing: enableInternalProxy is part of the (global) extension configuration while the newly introduced plugin.tx_dlf.settings.useInternalProxy is a typoscript setting. Their differences are only marginal: the first option globally enables or disabled the image proxy while the second options makes its use mandatory.
Maybe we should combine both options into one? We could expend on enableInternalProxy like this:

Instead of being a boolean switch, enableInternalProxy should be of type options (see Extension Configuration)

  • If enableInternalProxy = off the behavior would be the same like currently enableInternalProxy = 0: the use of the proxy script is completely turned off irrespective of any typoscript settings for individual plugins. This should also be the default.
  • If enableInternalProxy = always the behavior would be the same like currently enableInternalProxy = 1 AND plugin.tx_dlf.settings.useInternalProxy = 1. This would be the preferred setting for the DFG-Viewer 3D (but not the default for Kitodo.Presentation).
  • If enableInternalProxy = on the behavior would be the same like currently enableInternalProxy = 1 AND plugin.tx_dlf.settings.useInternalProxy = 0.

But I am not sure if I understand the meaning of plugin.tx_dlf.settings.useInternalProxy correctly. Maybe it's just a duplicate of enableInternalProxy and we should get rid of it?

from kitodo-presentation.

csidirop avatar csidirop commented on June 23, 2024

What do you think, @csidirop and @beatrycze-volk?

Yes I think we need a consistent way of doing it. I think the approach to leave it as it was by default and activate it as needed is good. But to be honest I haven't understood exactly what the internal image proxy does and what it's for.
I don't have any 3D models (nor do I know how) that I could test to see if it still works. @beatrycze-volk would have to test that.

from kitodo-presentation.

csidirop avatar csidirop commented on June 23, 2024

How should we proceed here?

from kitodo-presentation.

csidirop avatar csidirop commented on June 23, 2024

Okay thanks.

from kitodo-presentation.

csidirop avatar csidirop commented on June 23, 2024

It seams like with the version 4.x from 21 Jul 23 (38b64ca) the image is shown again.

Is this fixed or a workaround / temporally solution or even just a coincidence?

from kitodo-presentation.

csidirop avatar csidirop commented on June 23, 2024

Close the issue because it is probably fixed, even if it is not clear why.

from kitodo-presentation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.