[TYPO3-english] Image processing from typo3temp/ folder

Stephan Schuler Stephan.Schuler at netlogix.de
Fri Nov 8 16:58:51 CET 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi Arun.

Short answer: No.

You're not supposed to access the typo3temp contents yourself. If you use TYPO3 internal API calls, sometimes a resource gets copied to typo3temp. This is, e.g. done when you're using GIFBUILDER to manipulate images. Let's say for resizing them. Then the original file stays where it is (e.g. fileadmin/stuff or uploads/pics) and the resized copy gets stored to typo3temp. The typo3temp directory is suspected to be cleared at any point in time, you don't know when and why. API methods such as GIFBUILDER make sure the proper content is in typo3temp. They skip rendering if the target file is already in place, and they do render when the target file needs to be created. That's the only thing you need to know about typo3temp and that's the only way you should access typo3temp.

But don't assume that any file of yours being a property of a record gets transparently and by auto-magic copied to typo3temp. If there is files in typo3temp and you don't know exactly which API call created them, you definitively cannot rely on having them there a couple of requests later.

Your assumption "f:img is rendered from typo3temp" is wrong. It's just the other way around: The f:img view helper *creates* the files inside of typo3temp. Then the typo3temp file is exposed. But it's not just there and f:img accesses that but f:img makes it be there.

And this is why you cannot use the HTML img tag for typo3temp content: Because you cannot guess the file name and rely on it being there all the time.
Use f:img, or GIFBUILDER if you're not in Fluid.

If you deal with non-fluid plain records with "file" properties, there most likely is an upload folder configuration for that property. For tt_content it's "uploads/pics", for othe records it might be different. Here you can rely on finding the files. Nothing else.

And if you're using DAM, then it's different.

The f:img view helper btw. doesn't always respond with images from typo3temp. This is only the case if the f:img view helper needs to modify images. If the image is not modified. If there is no type conversion (GIF=>PNG, e.g.), if there is no changed resolution and if there is no other manipulation of the source file, then the file is not going to be copied into typo3temp but just exposed from wherever it comes.


But I really wonder why exactly you think you need to access files inside typo3temp.


Btw: The file name the file gets stored by in the typo3temp folder usually directly correlates with whatever happened for transformation. Usually, if GIFBUILDER is used, the file name is calculated by kind of "md5('{imagemagic command for file transformation}')". So if it comes to typo3 internal file handling, you cannot even guess the file name itself.


Regards,


Stephan Schuler
Web-Entwickler

Telefon: +49 (911) 539909 - 0
E-Mail: Stephan.Schuler at netlogix.de
Website: media.netlogix.de



- --
netlogix GmbH & Co. KG
IT-Services | IT-Training | Media
Neuwieder Straße 10 | 90411 Nürnberg
Telefon: +49 (911) 539909 - 0 | Fax: +49 (911) 539909 - 99
E-Mail: info at netlogix.de | Internet: http://www.netlogix.de

netlogix GmbH & Co. KG ist eingetragen am Amtsgericht Nürnberg (HRA 13338)
Persönlich haftende Gesellschafterin: netlogix Verwaltungs GmbH (HRB 20634)
Umsatzsteuer-Identifikationsnummer: DE 233472254
Geschäftsführer: Stefan Buchta, Matthias Schmidt



- -----Ursprüngliche Nachricht-----
Von: typo3-english-bounces at lists.typo3.org [mailto:typo3-english-bounces at lists.typo3.org] Im Auftrag von PIT Solutions
Gesendet: Donnerstag, 7. November 2013 12:45
An: TYPO3 English
Betreff: [TYPO3-english] Image processing from typo3temp/ folder

Hi List,

I've a custom extension which is used to display images in frontend.
In backend I've an image browse field in the TCA and the images are saved to a database field named "images".
In my code, for rendering images in frontend, I wrote a query to fetch images from db and append the path to it.
Suppose "test.jpg" is my image and "fileadmin/templates/images/" is the path.
Now I got the image src as "fileadmin/templates/images/test.jpg" and I've added it to my image tag.

Now the image tag looks like this;

<img src="/fileadmin/templates/images/test.jpg" alt="" width="100px" height="100px" />

But my problem is, I need to load images from typo3temp folder.

When using <f:img> in fluid template, its rendered from typo3temp folder. But when I use <img> tag its not from there.

This is a pibase extension and we can't use <f:img>.

So is there any php function to process the images from typo3temp folder?
Please help.

With Regards,
Arun Chandran
Software Engineer
PIT Solutions Pvt Ltd.
_______________________________________________
TYPO3-english mailing list
TYPO3-english at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english

-----BEGIN PGP SIGNATURE-----
Version: PGP Universal 3.3.0 (Build 9307)
Charset: utf-8

wpUDBQFSfQo8pp0IwsibV8MBCPoDA/9FujU5g7NF3TwTQDGwWSAKoPlBYEr3g+xd
Szq4AbzufHgpxkBkdbEvEmj+bbcbWmk/ubQYqLBTEOtD7ficWUEqviH0b5gftJNs
/U/Di0zPjvp7hHKS1Cp3PvJX8e4iy8h5G2KFWJIdiorQdgfuM+kihAbkHWBpzyt2
GzXN22LnQA==
=awSF
-----END PGP SIGNATURE-----


More information about the TYPO3-english mailing list