Image Duplicates

Author Message

Aristides Lamboglia

Thursday 12 April 2007 7:49:10 am

The web team in my company knows how to upload images and that is ok. The problem is that in our site, there are certain pictures we will use repeatedly, and some of our contributors don't know this so they'll upload a picture that is already uploaded again, and what happens is that ez publish doesn't save on top of the old one but uploads the picture AGAIN and this can happen millions of times.

My questions is where do I configure so ez publish if seeing the same file name just replaces the previous one on file?

thanks your help will be really appreciated

Aris

Heath

Thursday 12 April 2007 8:26:06 am

Hello Aristides,

The idea you offer is an interesting one. Perhaps there another with an idea for a custom solution to provide for this type of feature simply.

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Aristides Lamboglia

Thursday 12 April 2007 8:31:21 am

Yeah I was hoping this was included into the different settings but I guess it's not. I hope I could come up with a solution but i don't have the slightest idea how to do it. If anyone there is in the mood to do this it would be really appreciated. thanks guys!!!!!

Piotrek Karaś

Thursday 12 April 2007 8:53:10 am

As far as I know, it is the particular content object rather than its original name or source that eZ publish is focused on. I guess it is only possible to update an image/file attribute within given object.

We've come across the same problem before, and the only solution we found was good planning of media repositories, including consistent media classification and naming.

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Aristides Lamboglia

Thursday 12 April 2007 9:16:07 am

I appreciate your advise but i just can't figure out why. I'm even using the SAME file, same size, and ez publish will save it using the same file name, I don't understand why ez publish will give different attributes if they are exactly the same....Hope someone else can enlight me on this...

Piotrek Karaś

Thursday 12 April 2007 9:19:06 am

Are we talking about two different file objects? Can you describe the process of adding images so that we are certain that we discuss the same thing?

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Aristides Lamboglia

Thursday 12 April 2007 9:42:47 am

ok no problem. Lets say that Im creating a new file. What we call her a postcard. In the description where you would put your text and stuff, theres a paper clip button I press it and it would ask me to upload the file, then i specify where i want it (the folder in the MEDIA part) then i put the attributes to it and it gets inserted. lets say i save that postcard, then open a new one, do the same thing and VOILA i have two exact same pictures with the exact same name in the folder.

I even opened the page in internet explorer and did some properties on the pictures and somehow ez publish adds a "_05" for example to the file name but inside ez publish I don't see that. so in my IMAGES folder i have for example

PIRAMID.jpg
PIRAMID.jpg
PIRAMID.jpg
PIRAMID.jpg
PIRAMID.jpg

and when I go to internet explorer i see when doing right click on the picture and properties

PIRAMID_01
PIRAMID_02
PIRAMID_03
PIRAMID_04
PIRAMID_05

Hope this explains how I insert a picture in the text.

Piotrek Karaś

Thursday 12 April 2007 10:38:14 am

I was hoping for a little more technical description, but it really sounds like publishing instances of a class, that is objects, with a file/image attribute. In any such case, files do not exist by themselves, they belong to the published content.

But it's a good point, I haven't so far seen any eZ's ability to limit creation based on some data features and not system settings such as privileges, sections, parent nodes etc.

I hope I was able to catch the idea. In any way, sorry I wasn't able to help out.

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Bartek Modzelewski

Thursday 12 April 2007 1:31:18 pm

I think it's possible to do.:

All you have to do is to develop custom workflow with "before publish" trigger. Then in your own php code called by workflow, you can check any file attributes like file name and/or file size and compare it with existing files/objects. You can even compare hash of that image, but in this case you will need to keep hash of every uploaded image. So if hash (or other attribute) tells that image is already in content tree, you can terminate creation of new object/file.

If your site is busy, you will need to use some fast comparation method, like direct sql queries.

Please correct me if this method is wrong :)

Baobaz
http://www.baobaz.com

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.